Im confused. if you are using SheetCAM you can do everything in the POST including adding the values you want set in the UI in SheetCAM.
A touch off and lift to top of material , zero the Z and raise to pierce height is about 4 lines of G-code and no macros. is a super easy snip of code. You have a variable named swtichOffset. It's always in mm if its set in the post as a hard number.there is another variable named refDistance .
Using a Plasma Post like the MP1000-THC, it will have the variables defined and you simply put them in . The touch off stored G-code is a call of a G31 (probe) or G28.1( homing move
All of the code is there in that post and all you have to do is put in the switchOffset and the refDistance (distance between touch off) and it does the rest. You can even enable and disable the THC after the pierce if you want.
The code to zero the Z in MACH is : G92 Z0.00
SheetCAM has built in numbers for each plasma tool for prierce height, pierce delay, cut hight and end of cut delay. You don't have to write macros . Open the Plasma Tools and see the built in numbers and those are passed to the POST and put in the ONPenDown() function
You are using the built in and defined variables in SHeetCAM not MACH
SheetCAM uses LUA language for POST. While it resembles some aspects of VB Script in MACH its not the same. You also need to be aware that Macros running from MACH via a call from the Gcode will cause a motion pause in MACH.
THere is a rich set of POSTS in SheetCAM for MACH