Mostly in improvisation. In many cases, it's just evidence of the player not having "anything to say", and a cheap out in such circumstances.
The quote idiom goes way back. It is used mainly as a musical
bon mot rather than as a substitute for an idea. It is, in itself, an idea, but only when applied spontaneously and creatively.
Some jazz courseware actually teaches the idiom with examples. That abandons the spirit of the idiom, methinks.
Satch used to quote a pop 20s tune when he played Ain't Misbehavin. I played a gig with Allan Vache last night, and he played the same quote. From 70 years ago. In that case it's not the player not having anything to say. Allan has a lot to say on his clarinet.
Art Tatum was a prolific quoter. Dexter Gordon, too. Anybody who says Tatum and Dex had nothing to say can meet me at the OK Corral at high noon.
The written quoting, in the Basie number as in many others, is a norm, Much of music is repetition in any event, and "Pop Goes The Weasel" seems to fit the rest of the chart in your example.
As I recall, the accompanying chord changes are reharmonized to fit the solo. We're playing the chart in a rehearsal band Wednesday. I'll have to take a look.
Another one that crops up pretty often is the "Jingle Bells" schtick that some trumpet players like to throw in at the end of an otherwise "non-Christmas" tune.
Yeah, Dexter quoted "The Christmas Song" on the bridge to "Body and Soul." Now everybody does it.
And the Star Trek theme over "Out if Nowhere." Clever the first time, but beaten to death.
Once you can identify and discuss a quote, it has become a cliche. The ones I like are the ones that just come out of the blue, and particularly if the line of the quote is suggested more rhythmically than melodically or if the line is matched to a chord sequence that is not in the passage being quoted. Bird was really good at that.
Bassist Lou Morrow says that whenever he comes up with an original quote, the next night the other players are playing it.
I had a trumpet player once who used to wear that one out, despite specific requests not to. I don't have that trumpet player any longer...
Only because of the quote? I can see the severance notice. "Fired on account of Jingle Bells."
The Orlando guys have an onstage ritual whenever a player does a quote. They dig in their pockets to present him with an imaginary chit indicating that he now owes the band a drink.
I used to quote Dixie on cornet in a Dixieland band because the bass player refused to play the tune and would stand tacit if it was called. It was his social statement of the time, I think. I'd sneak it in when he wasn't expecting it.
I like quotes. They make me laugh.