yep, that's the same idea! i'm happy to share the code once i clean it up a bit, and you should feel free to transfer any of the functionality. there are few features i added which i really like, such as a support for LSP and type hints in an external IDE, plus an ability to write the code outside, while the add-on auto-regenerates the node-group if a file is changed. another cool thing is you can inline functions, i.e.:
# these two are automatically inlined (i.e., nodes added to the active group)
@inline
def foo(x: float, y: bool):
return x**2 if y else x**3
foo = lambda x, y: x**2 if y else x**3
# while this becomes a reusable node group
def foo(x: float, y: bool):
return x**2 if y else x**3