You could emulate it a bit by using waits in your automation to try to detect it, but it’s better if the device itself supports it so it sends a different command back to HA. For instance, my Inovelli switches support multiple button presses and then I can read the information sent to HA to know how to deal with it.
The idea would be to receive the first press and act on it then “wait” and if you get another one within 30 seconds you do the next action or even wait again for the third instance. It would be a bit squishy because you never know if the switch platform is sending it in a timely manner (i.e., Z-Wave congestion or the device is just laggy in sending back to HA). Certainly possible.