I'm not sure I'm understanding fully.
If it is down for maintenance, what do you want to happen ?
Normally, if it's down for maint, then you probably don't want it displaying any Zen Cart content.
If you wish to manually detect whether the site is down for maintenance, you'll need to let it launch application_top and then read the value of the DOWN_FOR_MAINTENANCE constant.
If you're trying to control display of the Zen Cart content via this external sidebox code, then you'll need to call the code, and let the code control the output, rather than wrapping the code inside output that you wouldn't want if the site is down for maintenance.
How often do you take your site down for maintenance anyway?
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.