in reply to Stop loading of HTML

I am calling a script from within an HTML document using a exec cgi and would like to stop the loading of the rest of that HTML document depending on the return of the script. Any suggestions? Thanks in advance.

You're on a dead-end road. Without resorting to major duct-tape and chewing gum, with SSI you can't influence how a server handles the enclosing HTML.

Invert the process. Disguise the CGI as a .hmtl file (if you must), and have it generate the HTML. This gives you complete control.