Check to see if a field is within an array in twig

Simple answer: no. According to what Twig is capable of doing, your loop is optimized as is.

The better way of doing it is to check the values with a php loop and then sending the flag to Twig.