I understand that you solved your problem by altering your table from an array style table to a hash style table.
However for others that might stumble on this thread I'll add that Blizz has implemented a global function in UIParent that allows checking for the existence of a value in an array style table.
Code:
local exists = tContains(table, value)
checks if table contains value, table being of type {[1]=value1, [2]=value2,...,[n]=valuen} or {value1, value2,..., valuen}