Just delete it.
It might even account for why the ESP resets after so mant toggles - the parser seems to keep stumbling on after many 'var' type errors before eventually having a nervous breakdown.
I would also make sure you're running the latest (A21) release, cos although new releases may possibly introduce some previously unknown problems, they invariably do fix most previous know instability issues.
If the pin is too sensitive I would think it's probably because the pullup resistor isn't strong enough - something around 5K to 20K should be ok, but you could go down to 1K if necessary and battery life was not a particular issue. The other thing to watch for is keep your pullup resistor wires as short as practically possible, cos they'll effectively be acting as aerials for any invisible emf... unfortunately that's probably easier said than done if you're using a breadboard for connecting up the pullup resistor.