ROMEO Pardon, good Mercutio, my business was great, and in such a case as mine a man may strain courtesy.
MERCUTIO That’s as much as to say, such as case as yours constrains a man to bow in the hams.
ROMEO Meaning to cur’sy.
MERCUTIO Thou hast most kindly hit it.
ROMEO A most courteous exposition.
MERCUTIO Nay, I am the very pink of courtesy.
ROMEO Pink for flower.
ROMEO Why then is my pump well flowered.
MERCUTIO Sure wit! Follow me this jest now, till thou hast worn out thy pump, that when the single sole of it is worn, the jest may remain, after the wearing, solely singular.
ROMEO O single-soled jest, solely singular for the singleness! (2.4.42-56)
Mmmm, shoe-related humour. Top banter. The central point here is, Romeo can keep up; he’s being witty and quick and giving as good as he gets. There’s some dodgy word-play on case, here meaning situation but also commonly used to refer to the genitalia of both sexes. To courtesy is to bow or curtsey (which involved the legs for both sexes in early modern England); the hams or legs (specifically thighs) might be weakened, bowed, by (sexually transmitted) disease (the bones, in the previous exchange). Romeo’s being polite – I’ve been busy with something important, that’s why I didn’t tell you where I was – Mercutio is the one who twists it (of course) but Romeo takes it back to courtesy. Mercutio twists it again, you’ve hit it, you’ve got it, but also the now-familiar hit as sexual penetration. Mercutio is of course being anything but courteous here, as Romeo ironically acknowledges. To call someone the flower of courtesy would be quite conventional; Mercutio’s testing Romeo here by playing with the cliché and naming a specific flower. (Although pink can also mean the height, the quintessence; the OED tells me that in Renaissance usage it can also be a minnow, looking back to the fishiness of the previous exchange, and a dandy, ditto, and a small ship, looking forward to the sails which will be invoked later on, or perhaps this is too much even for Mercutio.)
Romeo, however, makes a connection with shoes, as you do (possibly because the decorative knots and bows of ribbon or lace which were worn on shoes were known as shoe-roses – aha, a rose by another name!) and because shoes – especially pumps, light dancing shoes – might be decorated (as brogues still are) with pinking, patterns of little holes or pinked edges, like the pink or dianthus flower. Remember that, as they were on their way to the party, Romeo complained that his friends had dancing shoes with nimble soles, while he had a soul of lead. This second punning moment partly refers back to that: we know that Romeo is now running on air, leaping walls with a single bound etc; he was wearing his dancing shoes all along. Hence the sole-soul stuff here: the soles are single because they’re thin and light, not multi-layered and, like the sole of such a shoe, the jesting here is pretty thin too, as Mercutio points out. But Romeo is on fire, and Mercutio can’t quite believe it.