It might not be a terrible idea to make an extensible, general-purpose engine for stuff like this. It might save people the hassle of starting an overly-ambitious project with Twine only to either be forced to jump ship (Tentacle Slave, Summoned By Accident, probably more…) when things get too hacky (or evolve into a Cthulhu-esque monstrosity like Degrees of Lewdity's codebase).
I'm referring to Blazor WebAssembly, which produces standalone client-side web pages by compiling the .NET runtime and all of the supporting libraries in web assembly.
*To be fair, I think this is mostly caused by the angst of having to occasionally support Classic ASP apps written with Netscape 4-era JavaScript at work.