Can I export an Applescript as a Preference Pane?

Xcode Required

No, Xcode is required to build a preference pane on macOS. A preference pane is a specialised CFPlugIn bundle that registers a set of callback functions. From there, an Objective-C runtime can be set up and a view provided to the host application.

Today, with macOS 10.15, the CFPlugIn plug-in architecture appears to be supported but not widely promoted by Apple. Applications using plug-ins require additional sandboxing/hardening requirements. I expect they will be phased out or required to operate within their own isolated processes.

Simple Preference Pane Example

Apple's archived Implementing a Simple Preference Pane provides a tutorial that may be enough to convert your AppleScript approach to a Preference Pane.

Having written and supported a commercial product that used a preference pane for much of macOS's early years, I recommend sticking with an application approach.