No warranty given or implied.
This might do what you need, you may have to change the logic check depending on which way round your home led's work.
1. Edit your 1024.set using MachScreen.
2. Click the Cycle Start button.
3. Change the 'Standard Code' to 34 (Execute Basic-Script), select std code in pop up window. Click OK.
4. Copy the below script in to the window that pops up clearing any text that is in the window first.
5. Save the screen.
Dim x_home As Boolean
Dim y_home As Boolean
Dim z_home As Boolean
x_home = GetOEMLED(807)
y_home = GetOEMLED(808)
z_home = GetOEMLED(809)
If z_home Then ' this might have to be If NOT z_home Then
Message("Z axis not homed, homing now")
Sleep(25)
DoButton(24)
While IsMoving()
Sleep(25)
Wend
End If
If y_home Then ' this might have to be If NOT y_home Then
Message("Y axis not homed, homing now")
Sleep(25)
DoButton(23)
While IsMoving()
Sleep(25)
Wend
End If
If x_home Then ' this might have to be If NOT x_home Then
Message("X axis not homed, homing now")
Sleep(25)
DoButton(22)
While IsMoving()
Sleep(25)
Wend
End If
DoButton(0) ' Cycle Start
End