Sorting shapes by outline colors, including Groups

Hello, all.

Yet again I am coming up with more and more peculiar questions. This time it is about using CQL or something else to sort things by outline colors. What is necessary, is sorting the shapes by their RGB outline color G value (I have to use that because it is the only thing another system can change as far as shape data goes). This works great with regular shapes:

ActiveRange.Sort "@shape1.Outline.Color.rgb.G > @shape2.Outline.Color.rgb.G"

But, as discussed in the other topic, grouped shapes are unable to return outline colors. So how to sort a ShapeRange of both shapes and shape groups based on outline colors? Is there an easier way than making some sort of an array with StaticIDs + outline colors (read from inside the group when necessary), sorting it based on the color value and then rearranging a ShapeRange by going through that array and just sending things back or front in sequence?