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
Fix style warning for exception catch

Refs #8513
Fixed warning for unused variable

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