Rather than parent them deep into the hierarchy and then move them to a group, it's probably better to make them where you want them in the first place. This is completely possible, but not quite as straightforward as we'd like. I've attached another example script with a couple of options. The simplest one builds a sparse hierarchy that matches the environment but contains only lights, and the more complex one flattens it so all the lights are grouped under one parent. Even more complex versions are possible, where you parent the lights somewhere relative to the geometry location, but I'll leave that as an exercise :)
We'd like to wrap this up into a single node because it is something that crops up fairly often. The main question is how it should be parameterised, because different folks want to parent things in different places at different times. If you have any thoughts, then please let us know!
Cheers...
John