From the docs it seems that for now you can load custom code at page level only in the published version.
There are a couple of dirty workarounds for loading the scripts in the editor using the global wwLib (hint: wwLib.wwUtils.addScriptToHead). Warning: this is not official and may break, also, unlike the published version, your library now will not be there until the script loads and is parsed (it should be ready when the returned promise is fulfilled).
A safer option could be to create a custom plugin. In this way you can bundle the library with the plugin and expose actions and formulas to use in the editor in a clean way. GitHub - weweb-assets/plugin-dayjs can be useful.
In my case I opted for the plugin also to test how it is the dev experience. I am planning to release the code soon.