How can a script detect if it has access to some Security & Privacy parameters?
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.