Lua tables are essentially references, so it's not that uncommon/difficult to have some nested loops.
For example, this is really all you need for setting it up:
Lua Code:
local foo = {}
foo.bar = foo
I'm not sure that you can throw a recursive table structure into SavedVars normally, so probably create it elsewhere and do a deep copy that removes those references.
Here's a gist someone put up on different deep copy methods:
https://gist.github.com/tylerneylon/...21109155b2d244