As Sid has said debounce will indeed solve your problem, how mach homes is the following. You tell Mach to home and it moves towards the switch, once triggered Mach then reverses the axis untill the switch is deactivated. Because you have a twitchy switch if yoiu set the debounce higher it should work better, try a setting of 2000 and if that works go lower until you start getting problems again.
If you want your axis zero position to be other than at the switch, such as a lathes X axis where you want the zero position to be axis centre, you can set a home off. What this does is when you home it will do as above but instead of setting the DRO to zero (machine coordinates) it will set it to your home off amount. It wont however move the axis to the zero position as that could be dangerous (crashing tools etc)
Hood