Hi,
just one addition - check for "NetObj" class here:
else if (classof(o) == "NetObj")
is unnecessary - GetObjectChildren will only return objects of class NetObj and derivatives. Even more, that way you may miss some nodes on next levels, for example if you have cluster object - then it's class will be "Cluster", not a "NetObj". Simple "else" is enough here.
Best regards,
Victor