That's correct. As Peter mentioned, you can prevent any code to be executed only on the live site. The whole macro could look like this:
{% if (PortalContext.ViewMode == "LiveSite") { %}
HTML code including SCRIPT tags executed only on the live site
{% } |(identity)GlobalAdministrator%}