This sounds like what we went through with our son when he was about 2-1/2. We finally went back to the pediatrician enough times with concerns of a cough that wouldn't get better, with congestion, etc, that they sent him for a chest x-ray. Well, THAT looked like he had a partial collapse of one of the lobes of his lungs. So, they thought it was pneumonia (which was very scary to me) and started him on medications for that. They repeated the chest x-ray a little while later, and it still showed the partial collapse. Even more scary, right? So, they sent us for a chest CT, which we had to repeat because he wiggled, because it was scary for him. The second one they had to sedate him for. And, then they referred us to the Shands Pediatric Pulmonary Clinic. When we saw the doctor there, she said "He's got asthma. It's not a big deal. It just presented itself in an unusual way." So, they gave him an inhaler, which we used faithfully for about 6 months, and now we only use it when his allergies act up, because he has what they call "Reactive Airway Disease" (apparently, it is no longer okay to say a child has asthma) and it acts up whenever his allergies do.
Shorter story, have the pediatrician check it out, it might be something that the Dimetapp can't help at all, and it might end up being something as simple as mild asthma.
Hope that helps!