Handle exception throws on script save cancel

Catches SaveCanceledException thrown when user cancels saving from the
save as dialogue
Refs #8513
Fix formatting issue

Refs #8513
Merge branch 'bugfix/8513_fix_script_window_save_exception' into develop