This functionality would be really hard to do and it would tax your system based on how template sensors work. What are you trying to do exactly? maybe there is another way to do what you want in the long run.
i have setup a button that toggles a switch when the button has been pressed once, the template sensor will show “1_click” but if i press the button again it won’t toggle the switch until the state of the sensor changes to a different state.
I’m not entirely sure why you even need the template sensor if your sensor.button_2 has individual states for each click type. Simply using the to: state method should work even if you are going from the same state to the same state. The only possibility is if your device is suppressing the second click a few moments later. Have you tried looking at the logs and seeing if the event for the second click is coming through?