So you basically want to use Elm as a scripting language where your backend?/frontend? will execute code that isn’t trustworthy because it is delivered over a network? To do what sort of work?
You can embed two Elm programs into the DOM
const app1 = Elm.App1.embed(document.querySelector('#root1'));
const app2 = Elm.App2.embed(document.querySelector('#root2'));
There is also the possibility to run an Elm app inside a WebWorker
const worker = new Worker('your-elm-app.js')
const app = Elm.Main.fullscreen();
Something exotic would be to create an iframe via JS that loads another app.
You can indeed de-/serialize your whole state and put that through a port.
There is no Elm debugger I know of, you could step through the emitted JS source but that would be rather tedious.
Without more details it’s hard to tell what you may need exactly 