You change gears by Hand?  If so, I have a set up on my Bridgeport that involves a VB script made by Hood ( Thanks )and a brain.    Basically the brain looks for an input that is made when the high gear is engaged.  This way MACH knows if I am in high or low gear.  Then the VB script looks at my program if the S command is not in the range of that gear, it stops the program and asks me to change gear.  When that sensor sees that I am not in the wrong gear I hit enter and everything continues.
 
That red thing is a proximity sensor.
This might not be your situation, but here is the macro  
rpm = GetRPM() 
Setoemdro(1111,rpm)
newrpm = GetOemDRO(1111)                     
CurPull = GetOemDRO(56)
If rpm > 999 And rpm < 8501 Then        
Pulley = 1                              
End If  
If rpm > 99 And rpm < 1000 Then         
Pulley = 2                              
End If   
If Pulley = 1 And CurPull = 2  Then      
DoSpinStop()                             
While IsMoving()                         
Wend
Do
MsgBox "select main gear then press OK"  
If IsActive (InPut1) Then Exit Do        
Sleep  10
Loop
Else  
End If                          
If Pulley = 2 And CurPull = 1  Then
DoSpinStop()
While IsMoving()
Wend
Do
MsgBox "select back gear then press OK"
If Not IsActive (InPut1) Then Exit Do
Sleep  10
Loop
Else
End If
SetSpinSpeed( newrpm )