What tends to happen in writing is the production staff catches wind of how a character is received by the audience and this feeds back into the writing. So the initial concept of the character can sacrifice itself on the altar of public expectation. I think over time Q was seen as a cuddly fan-favorite that they could trot out for instant ratings. But once a recurring character gets this kind of success, it's hard to keep his rough edges and keep him restrained. So he was used a crutch for a show that wasn't firing on all cylinders.
No matter how buffoonish Q was written, he was never anything less than entertaining to watch (and more importantly, listen to). DeLancie's voice is one of a kind, which is why he's got a good niche now as a voice actor in My Little Pony.
When they did the TNG reunion (I think it was THE first if not one of them) and DeLancie stepped onto the stage, he got more applause than anyone. That says a lot about his importance to the franchise. For all the criticism Gene has received for making TNG dull in the early days, he did bring us Q, which was probably its biggest bright spot.