Make layer dialog active using script

Curious. When you say sort layers what do you mean? Does this inspiration in thinking lead to some kind of popup menu to move objects to layers? (A UI workflow improvement)