You can adapt the original solution to read files until it finds one that is not excluded:
while IFS= read -r -d '' line
do
file="${line#* }"
if [ "$file" = './my-excluded-directory' ]
then
continue
fi
[do stuff with $file]
break
done < <(find . -maxdepth 1 -type d -printf '%T@ %p\0' | sort -z -n)
(`-d ''` is equivalent to the original, because you can't have NUL characters in strings.)
`read`ing a long list is slow though, and @mosvy is right that you can do the filtering with some rather nasty `find` syntax:
IFS= read -r -d '' < <(find . -maxdepth 1 -type d \( -name 'my-excluded-directory' -prune -false \) -o -printf '%T@ %p\0' | sort -z -n)
file="${REPLY#* }"
# do something with $file here