Freezing the motors for Z axis height adjustment using Macros

Some times, I need to adjust the laser height in the middle of a process and you can’t afford to bump the X or Y axis so I figured out a great solution. I created 2 macros. 1 to lock the stepper motors and the other to unlock them. It is as simple as adding this code to the macro buttons (right click)
Macro 1: Lock Motors

$1=255 (keeps steeppers enabled permanently after move)
g1 x0 y0 f10 (Issue a relative move command but with no physial movement)

Macro 2: Unlock Motors

$1=25 (set it back to 25ms or whatever your default is)
g1 x0 y1 f10 (issue another move command with no physical movement)

Do any of you have useful Macros to share?