You just need to open a text file, write your VB in it then save it as m***.m1s, *** being the number that you want the M code to be. M codes under 100 are supposed to be used only for Mach internals so user M codes should really start from 100 up. The location you save the Macro to will be the macro folder of the profile you are using, ie if using the standard Mach3Mill profile then it will be C:\Mach3\Macros\Mach3Mill
To activate an output you just need to put the following in your macro
ActivateSignal (OutPut*)
The * is the output number you want to activate.
To disable an output you will need to make a macro with
DeActivateSignal (OutPut*)
Hood