There are any number of ways to implement this kind of extensibility in Xojo, but no easy way, and you’ll have to carefully consider how much functionality you want to expose. Rough examples of various depths of integration:
Level 1: execute a script from a menu that takes actions outside of the app. For example, a menu that presents a list of AppleScripts.
Level 2: expose functionality that lets a piece of external code run certain predefined commands within the application. For example, a command that exports the current document as PDF.
Level 3: exposes an object and command model that lets external code create, manipulate, and delete objects; execute commands that control and connect those objects and other aspects of the app’s configuration and behavior. For example, a piece of code that creates a document, creates several objects and sets their colors to blue, and then saves the result into a file.
Level 4: same as level 3 but lets the user record their activities using the application into a script that the user can understand and modify.
The level of implementation complexity between the levels is not linear. Level 1 is simple; Level 2 is hard; Level 3 will likely require you to refactor your application; Level 4 will require you to refactor it a second and possibly third time. 
That said, the benefits of this sort of extensibility cannot be overstated. There’s a reason AppleScript is one of the few non-core technologies that made the transition from the old Mac OS to OS X: it was (and is) widely used to automate complex tasks, tying together multiple applications in ways that nobody could predict ahead of time, to accomplish tasks that no single application could complete. From the day AppleScript was released in 1993, professional users immediately latched on to it to get their work done, and nothing has ever come close to replacing it. The sheer flexibility of the model has stood the test of time.
Of course, AppleScript is a Mac-only technology, and you may want to use something else if your app is cross-platform or not on the Mac at all. But if your app is on the Mac, and you decide to go to level 3 or 4, I really urge you to take a look at implementing AppleScript. The fundamentals that you have to implement for AppleScript will be useful no matter what language you settle on.