i am not saying you didn't have the right to take him back, you did of course, as the shop you got him from offers this. what i'm trying to say is that this can happen with any chinchilla you buy. gut problems sometimes take a week or so to settle and soft poo is one of the easier things to treat. i myself would take an animal to the vet rather than return it because i would consider it mine regardless of how long it's been with me but of course not everybody thinks like that and that's why there are return options. but my point is that chinchillas do get sick, they do respond to stress and change tremendously and you may end up in the same situation.
and like you said.. he would eat hay out of your hand and was quite keen on you yet you chose to take him back rather than keep him and get him better... i am not criticising your course of action, i am just pointing out that the next kit may be the same.
from what you're saying it seems to me that the diarrhoea was a reaction to the pellets. if that's the case, the kit was not sick.