My syntax might be a little off, I stole this from one of my motion sensor automations. Setting mode:restart will make sure that every time the button is pressed, the delay restarts. You could probably even template this to handle single- and double-pressing in the same automation, but I can’t think of the exact syntax off the top of my head.
I don’t know what kind of events your Aqara Mini Button generates so the Event Trigger in the following example is merely a suggestion (you’ll have to adjust it to suit your needs).
I think I see the problem. Your Event Trigger is using data from a Deconz event, specifically id and event. However, in the template you are using the example I provided which was not based on a Deconz event. It uses event_type when it should be using event.
Try this:
- delay: "{{ '00:00:10' if trigger.event.data.event == 1002 else '00:00:20'}}"
I think that will work. If it doesn’t, put the quotes back for '1002' (but I don’t think you’ll need to do that).