GNBG,
You can do it a couple of ways, with a button placed on your screen or by making a .m1s file containing the macro and calling it up with a M(file number like 301, etc.) in the MDI line. The variables in the macro will have to be changed to suit your needs, settings, and screen.
The easiest is to place a button on your screen (along with a DRO for the plate thickness and the feed rate at which to measure at) with Screen4 and edit the script for the button in Mach3. Take a look at the script behind some of the other buttons and also look at the settings for some of the buttons in Screen4 (the exe for that is in the Mach folder). The Screen4 video will help to understand that part a bit and as far as macros, looking at what's behind some of the buttons in Mach3 and the wizards are a good place to learn by example. The DRO, Button, and LED lists on the Wiki are a must to have in front of you too.
If it's all more than you want to mess with, send me the screen .set file that you are using and I can place a button (with script) and a DRO on it for you and you can then dissect it to see how it works.
It's best to test this with a junk bit or a broken off one chucked upside down just in case.
Regards,