In the example below...does it rerun the commands every 16 seconds or run through all the commands and then WAIT 16 seconds to run again. This is a bit excessive in this example...but having fits with locks locking. I can only image it's the latter.
Not totally sure on your question, but I think it gets to the end then waits the 16 seconds at that point. Corrected below in next post.
For your locks problem though, I would suggest solving with the Mirror app: [TIP] Managing multiple locks with Lock Mirror system app
The next iteration of the repeat is scheduled when the "While" line is reached. It will be close for you, but that should (barely) be enough time for everything inside to complete before it hits the next run -- assuming there isn't more cut off than you did, which at least must have been (or should be) an END-REP.
But besides the above suggestion: have you tried Command Retry? That seems like it could address most of your concerns without building this logic yourself, though without a description of the goal you're trying to accomplish, it's hard to say.
THANKS for the clarification!
I did try the command retry. My locks have ALWAYS been a problem regardless of platform. It's even more crazy since the two that are DIRECT line of sight with the hub are just as flakey as the two that are not. Then add in that in the reality they are probably the most important/critical devices in anyone's install...it's even more frustrating.