Like I said earlier, all my fish are from walmart and petco and I tend to get the ones that needs TLC. What I use as a guideline is:
1) Most likely they aren't going to be active in their little cup, since its small and usually has very little water in it. What I look for instead are ones that are alert. When you pick up their cup, they should "respond" to you and not just continue to float in one spot. I'm not saying they should go zooming around their cup, but they should at least flap their little flipper fins.
2) aviod ones with "Fuzzies". Fuzzzies can either be fungus, or columnaris. Columnaris is hard to treat as it can kill in a day. I've had 5 girls die in the past month of columnaris
3) Clamped fins. While most bettas with clamped fins are clammped from stress or high ammonia, it CAN be a sign of illness. in my experience, a day or two in clean water clears up clamped fins. However if you choose one that is clamped, make sure there are no other signs of illness like fuzzies or Ick (which looks like grains of salt).
4) Fin Rot. Alot of them will have fin rot or ammonia burns - fin rot makes their rail fins look raggid and torn. It can be bacterial or fungal. However its easy to treat with aquarium salt (NOT table salt) and daily water changes.
The last one is swim bladder disease. It's not fatal and is usually caused by over feeding. Generally the fish is unable to swim down and just floats back up to the surface. Fasting and epsom salt cure SBD. Sometimes they can only swim on their side. Unless you are sure the fish has SBD and not some other serious issue, avoid fish swimming funny or having bouyancy issues.
OOOH and make sure the fish is NOT pineconning. Pineconning is a sign of Dropsy and is almost always fatal.
And that's my guide to betta shopping at petco and walmart. Good Luck
You may also want to pick up some aquarium salt and epsom salt, they are good to have on hand, as is stress coat water conditioner.