For Vorple/StructIO what I was imagining is more of an RPC system, rather than a scripting environment. When I implement Glk in StructIO I intend to allow direct access to StructIO too, but it will be via passing commands in JSON or YAML. It will be limited to quite basic element manipulation, but will be there for people who want more than Glk's windows, paragraphs and spans.
However with this new plan instead of a Vorple API that we access, there could instead be a Vorple library that could be compiled into the blorb. The paragraph IDs are just longing to be used for error folding. The jQuery subset I've been talking about will again be an API, but as it will be low level compared to Vorple we won't have to update it much, or ever. jQuery is frequently updated, but the core of it has been stable for a very long time.
Or you could stick to an API, either within Glk, or parallel to it. But then it would have tricky version management problems as Ben said. I think Vorple might well have a higher rate of change than Glk. (And the Glk rate of change we see now is higher than it's been in a long time!)
Oh, and I've just realised that we can use Web Workers as a much simpler and faster sandbox. They're quite widely supported now.
