You also have to consider switch hysteresis because that determines how much Mach3 backs off once activated.
These switches for example have to be backed off 5mm before they reset.
TZ-8104 Rotary Roller Lever Arm Enclosed Limit Switch | eBay