Pinkie didn't really learn anything, though, despite her claim. All through the episode, she still kept doing her own thing. The denouement wasn't her realising she'd been obnoxious, it was her continuing being her, increasingly so, in fact, in order not as much to make amends, but to almost forcefully extract an apology that would only serve to make her feel good about herself. Only luck could (and did) get her out of this. Also, consider that her pivotal help wasn't all that necessary at all; Cranky Doodle was sure to run into Matilda in Ponyville sooner or later, unless you'd have me believe he'd live like a hermit for the rest of his life, in which case I'd remind you of Zecora, who lives isolated in the forest and still visited once in a while even when the whole town feared her.
In other words, I didn't like that very much.