Of course, you can programme however you want.
I just want to advise you first to think of what can be solved via direct connection and for what the Wibutler is used better.
So that you will not make yourself unhappy.
Concerning your direct question I cannot help you, I did not implement complex functions in Wibutler, for this I use a Beckhoff PLC (which allows me complete free programming). Wibutler I use only as Alexa-interface to my PLC.
I don't know if it is possible to do something similar in Wibutler, but in my PLC I would use an
IF Button_pressed THEN
IF Actor-State is On THEN
But as I said, I don't know if you can differentiate between two cases inWibutler, perhaps someone else can help you with this.