Script help - Randomized key press interval

Quoting myself:

If you want to prevent that an instance of a macro launches while another instance is still running, you have some tools for that:

I tried to showcase how these work, compared to each other, here.