[Code] Sorting an array of class identifiers by ancestry

Ok I get it, its kind of like the family tree. And so the code is best structured accordingly.
I have some ideas for Ruby but I don’t know the code much. just start learning about a month ago.
Here is a question for you Dan. Say I draw up a kitchen cabinet with doors and make it a group. Is there a script you could write that would analyse that model group for all its points and faces and convert it to a script file. Like “kitchen.ru” format so you can have your models in scripts rather than a sketchup file like Kitchen.skp… I was looking for you email address to see if you would be interested in writing some code for me.