O.K., so it has to be small, very small.
Building it from standard components (microswitch etc) should be too bulky.What ressources do you have? Does it have to be off the shelf components, or could you build a custom switch?
In a custom setup you could build a contraption like the on I sketched from some bronce contacts and a plastic actuator.
If it has to be off the shelf components, it could be constructed from the smallest microswitch you can find plus an actuator made from e.g. plastic. But at least the mechanical construction would be a custom setup, too.
I haven't been able to find a pushbutton which has this function integrated. Some old Tube-TVs used to have a similar function as part of their mains switch. The contact would energize the de-magnetizing coil whenever the TV was turned on. Even if you could locate such a switch, it will be too bulky for your application.
Another way to go would be an electronic solution. You'd need a monoflop (e.g. NE555 based) that is triggered by the contact opening and closing, this being the tricky part because the monoflop needs to be triggered by the rising edge and the falling edge of the input (button closing and opening). You might need an addiional transistor and a pair of diodes to generate two edges of the same type from the button action.
The output of the monoflop could short circuit the two wires using a transistor.
Downside of this setup is that you need some kind of power supply to energize the monoflop circuit.
Regards,
Harald