Lua scripts as action in scenes

Thank you, This will work for one of my needs. the other need is still a count down timer. that will shut a light off 5 minus after it turns on. I have tried the delay. Here is what I have setup.

Action Event: Whenever switch state is changed :on (device 123)
Action: Off( device 123) Delay 1 Min

It dose not seem to do anything