How to create a simple loop?

OP was asking for the simplest, not the best approach. Using Timers is significantly more complex. This was also written will over six months ago.

Were I to respond today I probably wouldn’t have even though it is simpler. And in this case the rule only waits when there is an alarm which will be rare and probably happen at times when not much else is going on in OH.

@Yoinkz, the problem is you can’t have an else without an if statement.

The loop continues while the condition is true then exits and the code starts executing after the closing curly bracket.

So I think all you need to do is drop the else part and you are good to go.

See Design Pattern: Looping Timers for how to convert this to a Timer based loop instead of a while loop.