Call SetDro (2, PlateThickness)
This puts the PlateThickness value in DRO #2, which is the Z axis DRO.
That's actually an older way to do it.
I'd use this:
SetOEMDro(802, PlateThicknesss)
Which is the newer way to do it.
DRO, Button and LED numbers can be found in the Wiki:
Mach3Wiki
Sleep() adds a pause, in milliseconds.
Sometimes they are helpful to allow Mach3 to "see" what the macro just did before it moves onto the next step.
The Mach3 interface only updates 10 times/second, and this gives the screen time to refresh before continuing.