thats an enormously slow way of doing the test (at least for even vaguely large scenes).
but i have the same problem. maya has a stupid bug that if you have two objects with the same name, and you hit "set keyframe" on one, it actually creates a key on all objects with the same name. so having unique names really is pretty important. I kinda wish maya still forced unique node names, no matter what...
if anyone comes up with a solution, please do share.