I'm going to be honest and say I have no idea on how to implement something like this. There has got to be a simple solution out there, or maybe a different method of input that wouldn't allow for duplicate choices in the first place?
On another forum, someone pointed me to the site below. Have you ever messed around with anything like that before?
http://tool-man.org/examples/sorting.html