Toggle Macro Window & Script Sequence?

So I’ve been trying to open and close TellMeWhen Config mode and the Macro window in conjunction.

TMW is easy since /TMW toggles the mode, however /Macro only opens the macro window, but doesn’t close it.

So far I’ve settled for simply using two Macros:
/TMW /Macro
&
/TMW /run Close

Does anybody know of a command to Toggle the Macro window instead of just opening it, or does anybody know of a command to run /script’s in sequence similar to castsequence?

On first click it would open TMW config and Macro window, then on second click it would close TMW and Macro window?

Edit: I found a solution - This is the macro I ended up with:
/run if ( (MacroFrame:IsShown()) or (TellMeWhen_ConfigWarning:IsShown()) ) then HideUIPanel(MacroFrame) else ShowUIPanel(MacroFrame) end
/TMW

This will toggle TMW config & Macro window simultaneously, or close one or the either if only one is open instead of closing one and opening the other.

/run if UnitAffectingCombat("player") then else if _G["MacroFrame"] then if MacroFrame:IsShown() then MacroFrame:Hide() else MacroFrame:Show() end else ShowMacroFrame() end end

That will “toggle” the macro window properly, but it won’t do anything to it in combat (nothing can with Lua).