I'd say, nearly impossible.
Besides the issue that Paul observed, there is one more issue. For each shape, the list of assigned layers is based upon layer position, not layer name. So, ialphabetizing the names changes the layer that they represent. That is, if originally, 4th layer, had name "A", but after sorting, "A" is first layer, i.e. layer "0". A new shape, assigned to "A" is actually point to a different layer than a previously assigned shape with layer A. So, if previous shape, layer "A" would show up as "3" in its shapesheet, but in a new shape, after sorting, layer "A" would be listed as "0". This is a total mess!!!
Not only do you have to move the layer properties with the layer names, but you must, additionally, unassign and re-assign the layers for each shape. Thus, this become a much more involved task. But, not impossible. Unfortunate.