Added logic for creating the script_directory if it doesn't exist

Fixes an issue reported by @jasont35.