So we're actually working on our own Lua-based extension format for Scratch Everywhere! and I guess you could reuse it. It's been partially documented here: https://github.com/ScratchEverywhere/ScratchEverywhere.github.io/tree/feat/custom-extensions/extensions
It's also based on Lua 5.1 so it should be entirely compatible with LuaJIT.