In the Godot editor, changing a Node's type is as easy as right-clicking on it and changing it's type. If it's script extends from the class that is the type of the original node, you need to change it, but if it inherits from a class that both types inherit from, you don't need to change the script's extend constant.
So: assuming I've already created a script that is compatible with two different types of nodes, is there a way to switch between those node types at runtime? For example: creating a VBoxContainer that changes itself into an HBoxContainer and back again? As long as said VBoxContainer's script inherits from BoxContainer, it seems like there should be a way.
I couldn't find a changetype() or changeclass() function so I've been fiddling with replaceby() and getclass() and so far I've been able to get either nothing to happen or crashing Godot.