Recurring "UI element scripting is not enabled." in Mavericks AppleScript

If you use AppleScript applets to interact with UI elements, you may quickly find out that in Mavericks all seems to be broken. Every run results in System Preferences being opened to the pane that used to control UI Element Scripting, and finding the new controls in Security & Privacy -> Privacy -> Accessibility seems to have no effect.
This is a result of Mavericks splitting UI control authorization into per-app settings, combined with the Lion feature of remembering what windows an app had open when it was last closed.

Mavericks recognizes the app uniquely only as long as the app doesn’t change.
WindowState information is stored in the app if you have permissions to modify it.
These two features end up caught in a fight.

The following Terminal command will prevent this by passing ownership of the applet to root and blocking you from editing it without authenticating.
sudo chown -R root:wheel AppletName.app …

Source: Mac OSX Hints