I just ran into this myself, and it seems strange.
It seems that the "if" block is re-evaluted during execution of the "then" block. I have a program like this:
IF (backdoor light is off AND garage door sensor is on)
THEN {
turn on backdoor light
turn on some other lights
wait 15 minutes
turn off backdoor light
turn off some other lights
}
But the everything after the wait statement in the THEN block never gets executed, presumably because a condition in the IF block is no longer true.
Is this by design, or is it perhaps a bug? Maybe it's just the old C programmer in me, but it seems like control should remain with the THEN block until it has completed executing. Otherwise there is the possibility of an asynchronous event interrupting my program in the middle of execution and leaving my devices in the wrong state (e.g., projector on but screen still up). In other words, it allows for race conditions.
-Jeff