You can save a scene like this:
func save_scene():
var file_path = "res://your_scene.tscn"
var scene = PackedScene.new()
scene.pack(root_node_of_your_scene)
ResourceSaver.save(file_path,scene)
Note that when instancing or removing nodes from this scene, you have to set the owner or it won't get saved.
When instancing a new node:
$new_node.owner = root_node_of_your_scene
When removing a node:
$node_to_remove.owner = null
And make sure you don't override your original scene.