I have never messed with XUI2D yet, Although I should someday.
But it sounds like for what you are trying to accomplish, you need to write your own interpreter language that your software parses and executes to do what you want it to do, as well as being able to load the graphics assets from your file, or another file like a b4xobject.
Think of old school Commodore, Apple, TRS80, etc BASIC here.