Basically RandomWiktor says that quietly purchasing an animal living in poor conditions at a pet store is not a true rescue. It does indeed help that one hamster, but this is short sighted and does not help the problems in the long run.
There are two problems that are not being addressed in doing this. First of all purchasing an animal at any pet store only supports the animal mills from which the said animal comes from. (Don't know what I'm talking about? Read this too: Rodent Mills. Yes it's the same for hamsters, and even if your pet store gets from local breeders they are just a smaller scale of this). Secondly and in regard to this topic, by purchasing this animal you are saying to the pet store that it is perfectly ok to keep their animals in this manner. Another hamster will only take their place afterwards anyway.
So quietly purchasing an animal to save it or nurse it back to health is called a Sympathy Purchase. And while this act is good in intention, it is not in fact exactly good.
So what can you do then? RandomWiktor gives you some much better ideas. Including talking to management (letters, direct conversations, phone calls, etc), keeping up on their progress, asking for a discount on the ill animal, giving advise, etc. You really should read it!
I brought this up mostly because while this is common knowledge within some circles of animal lovers (betta fish and rat owners come to mind) it isn't always common knowledge in others. So next time you are tempted to make a sympathy purchase, stop and think about the consequences and what might be better action.