redpulse right 1 20
Is interpreted by the Lua interpreter as you trying to access the variable 'redpulse' and sees it's nil, however, the problem occurs when the interpreter tries to use 'right' as an operator on the variable 'redpulse'.
'redpulse' is actually a program. If you want to use that program within yours, then you can run it quite simply with the following line:
shell.run("redpulse", "1", "20")
This loads the 'redpulse' script and throws it on to the top of the program stack with the arguments "1" and "20". Thus, you get your desired redpulse of 20 seconds.
Hope I helped.