New with LUA

Help wanted!

Since my Vera proudly runs the LUUP release I begun to play around with LUA. I tried to rebuild a scene with LUA code but I didn’t found a piece of code for what I intended.

Here is what I want the scene to do:
On sunset a scene should start with
luup.call_action(“urn:upnp-org:serviceId:WindowCovering1”,“Down”,{ },32)
Than wait 20 seconds
luup.call_action(“urn:upnp-org:serviceId:WindowCovering1”,“Down”,{ },33)

Question: How can I define the delay?

A second question I have is how can I build a scene to toggle a device on and off x times? I tried something like:
do
local var, limit, step = 1, 4, 1
if not (var and limit and step) then error() end
while (step > 0 and var <= limit) or (step <= 0 and var >= limit) do
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=“1” },13)
wait
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=“0” },13)
block
var = var + step
end
end

That didn’t work.

Any ideas?

sorry, wrong forum