Fix script errors not being reported

Script.update event needs to be emitted after reporting any script errors.
Merge pull request #3140 from ctrlaltdavid/script_error_reporting

Fix script errors not being reported