Held down macro stops on its own without being released

I want to be able to hold down a trigger key to iterate over 8 key presses and repeat the cycle until the trigger is released/up.

After a specific number of cycles, the macro stops on its own without being released and I have to release it and press it for it to start working again.

A while/until loop seems like the obvious solution, but when I try those, the macro overlaps itself and escalates/snowballs in a funky way that continues to send input even after being released (based on how long it was held). It's important that there aren't any built-in timing functions to wait for the loop to complete before repeating.

I would really appreciate any help!

Use the Action UNTIL, there you can select key to be press down until... blah blah, etc etc

The default maximum time for a “is down” trigger to be held down is 10 seconds. This is to avoid cases where a stuck key or the like just continues forever.

You can adjust it with the Terminal command:

defaults write com.stairways.keyboardmaestro.engine MaxKeyRepeatTime -float 10.0

as described in the Other Hidden Preferences section of the documentation.

There is no need to restart the Keyboard Maestro Engine after making this change.