As far as the duplicate issue - options:
Create an array that lists the items in the first select statement, as well as a flag to indicate whether the user selected them. If the user already selected the item, disregard reselections.
-- or --
Use the sort
JavaScript sort() Method to sort the target array. That should make the search process quicker.
-- or --
Flatten the target array with
JavaScript join() Method and search the resultant string.