Not sure about the schematic for your circuit, but you might be able to use the button press to also provide power to a 4 pole (4PST or 4PDT) solid state relay. (each LED represents one encoder input, right?)
Each press of the button should close the relay longer than it takes for the counter circuit to advance.
When the button is released, the relay opens.
If the relay and counter circuits interfere with each other, use the button to drive a 2 pole relay with the 4 pole relay power on one pole and the counter circuit on the other.
Scott