Best way would be to use a flag that you could clear with another macro.
eg. Create a dummy appliance module say M2. This is needed to loop macro - M2. Then create 3 macros "M1 ON", "M1 OFF" and "M2". Also use flag 1.
Macro - M1 ON
Set flag 1 on
M2 ON
Macro - M1 OFF
Set flag 1 off
Marco - M2 ON
If flag 1 is set...
[enter commands you wish]
M2 ON
You would start things with the "M1 ON" macro and stop with the "M1 OFF" macro. This would not do a true purge but would exit M2 after completing a loop. This is actually preferable in most cases as you can predict the end condition of your controlled modules by finishing the M2 loop.
See also
this discussion.