It’s not currently possible, but there are open feature requests, e.g.:
- Feature Request: Import Notebooks · Issue #209 · observablehq/feedback · GitHub
- Feature request: Sync with Github Gist / Repo · Issue #284 · observablehq/feedback · GitHub
That said, if you log into Observable via Github and have 2FA disabled, you might be able to make it work with GitHub - mootari/observable-client and some custom code that connects to the Websocket and sends the necessary update messages. I don’t recommend it though, and the client is probably broken by now. In any case, see this topic for a lengthy discussion.
You can’t modify editor contents this way. The runtime lives in the sandboxed iframe and its only task is to run your notebook code.