Also, please test the code way above where it may crash into the table should the code not be right. I use different code and don't see any use for a double touch. You may want to change the F numbers (feed speed) too. F20 is 20ipm which seems a bit fast for homing. I made the assumption you were using metric based on the script values.