I’m not sure if the new script editor has a code property one can overwrite yet, but if/when it does one might use a workflow similar to this old GhPython one (i.e. where we write/read/overwrite scripting component source code based on an explicit naming/versioning scheme):