Here is my try at it. Though I recommend you take Poppabear's more professional guidance.
As far as I know a brain can not trigger a macro on it's own. So the macropump does that.
However brains are a no brainer to implement safety timers and lockouts. (pun intended)
The two macros that you posted need to be placed in the macro folder with the name of your profile. Eg. Mach3Mill
Call them M615.m1s and M616.m1s
The macropump calls the relevant macro when a user LED goes active.
It basically is one which Poppabear wrote for me a while ago. Much the same as posted above.
The brain sets the LED when the switch is pushed and held for 1.5 seconds but only if there is no motion, the spindle is not running and reset is not active.
Being an external momentary switch I think the 1.5 second delay is a good safety measure.
This means you must push and hold the switch for 1.5 seconds before anything will happen.
Do not want unintentional activation of either macro.
So the addition of the brain is just to allow for easy implementation of the safety lockouts.
Now take note I have done this as a learning exercise for myself. Have a look but rely on Poppabear for proper advise.
Greg