How about using extglob for advanced fit? Thus, you can use for to get the necessary extensions:
shopt -s extglob for file in *TH?(x|y)*.ats; do
*TH?(x|y)*.ats expands to those files containing <something> + TH + either x or y + <something> + .ats
Your script fails because it has a typo in it :
if [[ ("${file}" = THx) || ("${file}" = THy)]]
This is normal:
$ d="hi" $ [[ ($d == hi) || ($d == ha) ]] && echo "yes" yes
Although the brackets are redundant:
$ [[ $d == hi || $d == ha ]] && echo "yes" yes
source share