How can a script detect if it has access to some Security & Privacy parameters? I've created a script which uninstalls an application I've created. However, as you may know, in macOS Mojave the system requests the user's permission to allow said script to control System Events. If the user click "Don't allow", the script can't be run and the system won't request the user's permission for that app ever again.

Is there a way to detect if the user has clicked Don't Allow so that, next time the script/app is opened, the user is given instructions on how to allow it to control System Events? (Or even better, request his permission again).
Not really.

The permission dialog will only be shown once - after that the only options are to change the System Preferences > Security &amp; Privacy > Privacy >  Automation setting (which doesn’t reset the dialog) or reset the privacy database via the tccutil utility (see Apple’s tech note).

There is an AEDeterminePermissionToAutomateTarget function to determine if it is authorized to send an Apple Event to an application, but AppleScript can’t use it because it uses a pointer for the target application reference.

Also see this blog for a decent writeup about this mess.