Re: Before TC Script Ends, after Exception occurs.
There is an event handler called "OnLogError" that, upon logging any error, you can execute a script routine to do whatever you want. See the help documentation on that event handler.
You can also use OnStopTest which will execute any code at the end of a test. That way you can use Try/Catch to determine the critical nature of the error and, if that nature is such as to require a stoppage, then OnStopTest will execute your termination code.