isCancelled()
Returns true if the user has pressed the Cancel button during Dashboard loading, otherwise returns false.
This function allows a long-running script to be terminated by a user Cancel action. If a script does not check the isCancelled status and self-terminate, the Dashboard cannot be canceled by user action until the script has run to completion.