Toggle routine
A toggle routine does one thing on the first press and the opposite on the next.
In the free version of KeyRoutines you build a toggle with an If on a remembered value, like the AFK mode template: the first press mutes the sound and hides your windows, the second brings everything back. Pro's Modes do the same job and work out the undo steps for you.