Advanced Automations in Home Assistant

That blueprint is six years old and is not looping on that wait for trigger. It’s making an assumption that if the motion sensor just triggered will soon turn off, and if there’s more motion (i.e. a new trigger) it will kill off the running automation and start over. Seems more to support using triggers instead of long-running automations.

I just read your post from a year ago and I’m kind of surprised nobody commented about the long-running loop. Ignoring all the technical OOM stuff and HA restarts, that post seems like you have to jump through hoops to try and deal with the complexities of this approach.

I still haven’t seen what turning a long-running script into a triggered automation buys you.

My suggestion is like everyone else’s: use triggers for short-running automations and use templates to simplify or combine automations. And templates are an import part of your toolbox (so important that the Templating docs just got a full rewrite).