How to run an AppleScript when Safari starts up?
Safari won't automatically run the script on launch. The easiest way to run the script is to place the script in ~/Library/Application Scripts/com.apple.Safari, then you can run the script from the Script menu when Safari is running.

You can enable the Script menu if you haven't used it before from Script Editor, then the menu appears and shows all appropriate scripts. Enable the Application Scripts menu in Script Editor → Preferences → General under ‘Show Script menu in menu bar’.

I've updated the instructions on the linked blog post: Bypass ‘Safari no longer supports the unsafe extension’ in macOS Mojave: Next steps