The Lobster scripting integration is really meant to change the data in TreeSheets directly, while editing.
These tools however using scripting to associate code with the dialogue tree, for example to make certain dialog choices conditional on previous ones. That's a very different idea.
So TreeSheets is awesome to edit any kind of tree structure, and you could edit code in it, it would just be static data for the purpose of TreeSheets. It is in this case just a better replacement for editing indented text, which can represent the same thing but is harder to overview.