As @isolating says, this can be done in HomeKit by turning the action into a shortcut and then setting the shortcut so that if the garage door is open, set it closed, else set it open.
I had this setup working on three different flic buttons - two toggling different PCs on / off with the double click action (so single and long clicks could control the lights) and one to close / open a blind on double click. All was fine until a couple of weeks ago when they all stopped working. I know the shortcuts still work in HomeKit so assume flic has updated and broken something.