Setting PRISM scripts to only collect stats when set in global variables

This mirrors MAXIS scripts.
Merge remote-tracking branch 'origin/master' into beta