Looking at the code again, in both suggestions, the scripts make all 'unrelated' instances unique instead of making only the selected instances or their sub-components unique.
In TIG's code, all instances in other parents are made unique of each other (or at least that's what happens in my adaptation).
In the animation that Neil posted, in each 'Big Box' the small boxes are becoming unique (small_box#1 x 6, small_box#2 x 6, small_box#3 x 6... etc.).
I wouldn't want my operation on one Big Box and it's sub-boxes affecting the similarities of the small boxes in the other Big Boxes...
If I were to 'select' manually (with the mouse) one Big Box, 'right click', 'make unique'. Go into it, and select 6 small boxes, 'right click', 'make unique', it still only makes those selected unique, without touching anything else outside of context. I wish to replicate that exact function in Ruby without messing with other components "by accident".
Or, if I were 'forced' to mess with all other components (I'd rather not), I would want to maintain all similarities outside my selection. (including in multiple nested levels).