You can remove the resources in the Node.NOTIFICATION_EDITOR_PRE_SAVE and add them again in the Node.NOTIFICATION_EDITOR_POST_SAVE
Example:
@tool
extends Node
var my_procedural_mesh:Mesh
func _ready() -> void:
my_procedural_mesh = BoxMesh.new()
$MeshInstance3D.mesh = my_procedural_mesh
func _notification(what:int) -> void:
match what:
NOTIFICATION_EDITOR_PRE_SAVE:
$MeshInstance3D.mesh = null
NOTIFICATION_EDITOR_POST_SAVE:
$MeshInstance3D.mesh = my_procedural_mesh