Well, Bulbapedia suggests acute bronchitis or asthma, considering his symptoms clear up in clean air, but there are any number of illnesses he could have, really. I mean, he seems a lot better towards the end of the game, so it could be something like anaemia or even just a minor anxiety disorder that stops him from going out initially.
I don't honestly think asthma is too likely. I mean, he doesn't have an inhaler or anything, and that would be an easy way of showing that he had that. Sure, he doesn't take drugs either for his condition, but...drugs, in a child-friendly game. Even legal medicinal drugs. Probably not a good idea, at least not for humans.
That's the thing, though - anaemia clears up under certain conditions. Asthma doesn't, does it? Wally was so much healthier by the end of the game and, even if it's implied to be a lung condition, I just don't see how that can be true if Hoenn's climate is largely a mess. Getting away from Verdanturf might have done him some good, but it wouldn't have made him fighting fit. If anything, I would have thought he would have been worse by the end of the game, not better.
I do think if it's something to do with his lungs that acute bronchitis is more likely - that clears up by itself within two or three weeks, and it's not a stretch to say that travelling across the Hoenn region, and away from Mt. Chimney, would hasten his recovery and put him in much better shape - if not recovered completely - by the end of the game. Although considering he moves to Verdanturf from Petalburg, that makes his parents pretty irresponsible if that's the case...