Don't you just love Mach3
As it happens I do, but yes there are very few safety constraints in there - the CS-labs box was not around when Mach was written either
The hardest part is adding the logic to control human input - mach will do what you tell it, but if you tell it to run the code when not expecting it to, it will usually run the code as you found - this is not really a flaw i think, Mach is pretty much just a controller - you have to add the bells and whistles as i have been doing
How do you select the MDI screen, maybe there is a way in there, my screenset does not have it - the MDI is just a line on the main screen activated by pressing enter or clicking in it. Stopping the code running should be possible, its just a matter of where to apply the block and what triggers it.