Heres something to get you on your way. But yes youd need to clean the connector after you kill the gui, als the conector could work on first selected shape directly and then connect out form that. But basically thsi gui item is tied dorectly to attributes
CODE
window;
columnLayout;
$dummy=sets -n Dummy
;
addAttr -ln "dummy" -at long $dummy;
attrEnumOptionMenuGrp
-l "order"
-ei 0 "xyz"
-ei 1 "yzx"
-ei 2 "zxy"
-ei 3 "xzy"
-ei 4 "yxz"
-ei 5 "zyx"
-at ($dummy+".dummy");
showWindow;
proc ConnectAttrs(string $dummy){
string $conn[];
$conn=listConnections -s 0 -d 1 -p 1"Dummy.dummy"
;
for ($item in $conn)
disconnectAttr Dummy.dummy $item;
$conn=ls -sl
;
for ($item in $conn)
connectAttr -f ($dummy+".dummy") ($item+".rotateOrder");
}
scriptJob -e ("SelectionChanged") ("ConnectAttrs(\""+$dummy+"\")");
ConnectAttrs($dummy);