?In mach3 config> general Config in the top right corner have you tried to increase the debounce time. If not do not increase it too much or you willoverugn the limit switches. But also your plan to rewire the Z axis motor with better shielding and ferrite might help.
Dan Mauch