Macro window cache

Is there a way to retrieve contents of a tab that I closed in the Macro window?

I don’t think so.
Depending how long you had that tab open, you might be able to restore the preferences with TimeMachine.