I didn't understand how to use the first one.
It's easy. Save Sprite.AsJSON to a text variable. Later, when you need to restore, create a new Sprite instance and use "Sprite Set From JSON" action - it will restore its position, instance variables and all other properties from the saved JSON.
I would like the console.log to also write the object variables not related to the family.
You know which variables are related to the family - simply exclude/ignore them when running the "for (var key in o.instVars)" loop.
for (var key in o.instVars) {
if (key!="FamVar1" && key!="FamVar2") {
console.log(key + ": " + o.instVars[key]);
}
}