The problem is your trying to make an accurate Z motion with an air cylinder and a mechanism. I don't think that is ever going to happen.
I use a scribe BUT it is mounted on the Z slide and lowered into position when needed. THEN I have full ZXY control over it with Gcode. NO problems with timing issues trying to NOT mess up a decent engraving.
You will not get the precision timing control on your air cylinder control from a VB macro it will be as bad or worse than the G4 to control.
But if you determend to use what you have do as TWEAKIE suggested use the DIR pulse from a phantom axis to control the Solenoid. IT is extremely accurate and precise in it time slices.
(;-) TP