The pun seems to be something people tend to have strong, divisive emotions about: pun as fun or pun as repellent.
I would like to make a point about successful puns: they are not “merely language play” (assuming “mere” language play is possible: if it is still language, then it is still conveying a meaning beyond symbol and, therefore, is not an inert “gimmick”).
My sense is that writers are generally taught to not be “too clever” or not call too much attention to their language; I would say that depends on the aesthetic. If one’s goal is to not call too much attention to the language, then one is attempting to write absorptive material: something that “sucks the reader in,” as its advocate may say.
On the other hand, if one wishes to acknowledge the performative nature of language and not attempt to pretend language is purely communicative, then one could acknowledge language as fundamentally markings while also symbol. A pun indeed does this: the use of replacement homonym and/or homophone acknowledges the marking and/or sound nature of language while still conveying meaning: it conveys the original statement and it conveys the new statement, and the reader/listener experiences both as simultaneously as possible (and those who are uncomfortable with “mocking”/twisted imitations groan).
The pun is a linguistic irony (for the aforementioned reasons of simultaneities and because language itself allows for the pun to happen).
The pun is like a mini-form of satire of the English language (which can be significant for a postcolonial culture!).
To offer an example of a pun/a sentence functioning with pun mechanisms, here is this sentence from a poem I wrote in early September: “Platonic and gin not the best glass at the Academy.” “Platonic and gin” is a pun of “tonic and gin,” thus evoking drink and ancient Greek philosophy (as well, perhaps, as the often-used term “Platonic love”), but the sentence drives onward with this mixed metaphysics with “best glass at the Academy”: “glass” punning on “class.” Not to get into ’pataphysics too much (’pataphysics is a step beyond metaphysics, so to speak; a pataphor speaks as though metaphor has created a new reality), but the movement of the sentence is ’pataphysical: the theme/“reality” established by the first pun holds through into the next one.
With this in mind, I would like to think that successful puns also bring with them ’pataphysical achievement.