Punk was a star who could have been a megastar, they squandered that chance.
That "for close to a decade" period you refer to where ratings are basically stagnant, is the Cena era. Cena has brought stability, but it's a pretty low level of stability.
According to what could he have been a megastar? It's easy to say this without having anything to back it up, which none of us do. All we have are those small bits of data, and those MITB PPV numbers aren't impressive, nor are viewership peaks of 4.84 million when apparently there is so much buzz. Both Batista and Cena in their peaks were much bigger than CM Punk ever was.
It takes months to build a consistent draw but your peak doesn't last years and years, but if even Cena could not become bigger than WWE wanted, after years of effort, after he initially made bigger waves than CM Punk ever has, what makes you think CM Punk would? Off what are mild numbers?
What's most important is the overall roster in my eyes, not one guy. WWE's quality is hurting today because they don't have the kind of overall starpower they once did. There was a time where they could build two brands with enough stars on each show, with veterans and newer stars. Raw was doing over 5 million viewers here and there in 2005, and leading into Wrestlemania 21, which did a buyrate of 1.1 million. And that PPV had no mainstream stars, just a stacked card, headlined by a new star. They're struggling today with one brand. However, they're also in a better position today than at anytime post-2010 I think. Bryan is hugely over. They have Reigns, Rollins, and Ambrose who are looking like future main eventers. Bray Wyatt is also a good supporting act with potential to reach the top too. It they do well, they'll have something fresh again for a few years. Maybe.
Having said that, I don't think they'll ever bring back old viewers. It's a soap opera, it's 'fake' as detractors like to say, and it's seen as a joke by most people. That stigma will remain, so I don't think it's a bad thing that WWE tries to focus on their core audience.