I don't know how that would happen either, but you might like to add a Semaphore Lock action to the start of the macro to ensure the macro always run synchronously - if you press Command-A a second time it will wait for the first macro instance to finish before starting the second.
By the way, a variant I did of this was for a Copy to Markdown macro, where pressing the trigger a second time copied it in a different style. It did this simply by:
- set variable First to whatever the first style is
- set variable Second to whatever the second style is
- if clipboard is not First
- set clipboard to First
- else
- set clipboard to Second