The problem with the above automation could be that you should have used the trigger type state and in attributes select the particular attribute of the sensor which shows single or double clicks.
Actually instead of using an automation and input_boolean for this, you can use a single template sensor which can combine both these functions together. Please try this.
If you do only want to toggle the boolean then you need to use a template trigger since the attributes aren’t available (as far as I know) for use in the state trigger. but I believe they are in the UI created automations. But I don’t use those so I just use a template trigger to get the same functionality.