What kind of remote-control are you using?
Instead of creating automations to process the device’s button events, looks through the Blueprints Exchange section and see if there’s an existing blueprint for the device. Some of the better ones support things like long press, hold, etc.
Assuming there’s a blueprint for your device, it’ll be pre-configured to handle the device’s events. All you need to do is indicate what you want each button event to do.
For example, here’s one for the Ikea 5-button remote-control.
Even if you don’t want to use a blueprint, and prefer to create your own automation from scratch, you can examine how the blueprint is constructed and get ideas for your automation.