What exactly are you attempting to accomplish? I'm a little confused because you, on one hand, want to randomly sort an array. But, on the other hand, you want to sort the array according to a known ordering. Those are (on the surface) incompatible goals.
My criteria for good software:
Does it work?
Can someone else come in, make a change, and be reasonably certain no bugs were introduced?