I fell your pain. If you happen to have Keyboard Maestro on your tool belt, take a look here:
The trick for this macro to work is find a reliable way to set the “Focus” variable to on or off depending on your work routines. Mine is tied to Focus App: whenever a Focus session is starts/stops it will trigger a Keyboard Maestro Macro that will set this variable to on/off.
If your hours are more fixed, you could create a Macro that will turn the “Focus” variable on/off depending on certain hours. Or even use those Mail Hours instead of the “Focus” variable altoghether. Like this: