While it doesn't give us many practical pointers on how to cultivate your improvisation skills (other than implying "practice, Practice, PRACTICE!"), it demonstrates a skill used by every RPG GM: characterization. Every character Robin assumes sticks in my mind. They're not throw-away, one dimensional characters. They're rich and unexpected and fresh, and they establish themselves clearly within one spoken sentence.
Every single character mashes together 2 ideas. One is readily recognizable (Indian mother, Rabbi, Bullfighter), and the other comes out of left field (Film producer, Out & proud, Fashion maven). In each case the ideas bounce off of each other, and a character larger than the sum of the two ideas emerges to hilarious effect.
Writers have heard this idea before: good stories combine more than one core idea. Neil Gaiman, Joan Aiken (via Philip Martin), Brian Clark, and many others give us approaches to try when mashing ideas together in order to make a good story, but the same approaches hold true when making good characters out of intersecting ideas.
This also resonates with Ray Winninger's idea that he put forth in the Dungeoncraft series of articles. In a nutshell, every time you create something in your game world give it a secret. This secret can be the second idea that motivates the character and makes them act in unexpected ways. And to take a page from the Robin Williams playbook, I'd make the secret come from a very different place than the NPC's more obvious character traits.
|"Really? Just a hat instead|
of a helmet? And that sash..."
I suggest you practice so you can have a few zingers lined up in case of emergency, and here's where a random table shines. Randomly roll a couple of character motivations (you can use the generator at Chaotic Shiny, the dice method at Rolang's Creeping Doom, the NPC tables starting on page 94 of the Pathfinder GameMastery Guide, the Ultimate Toolbox, or the Traits tables starting on page 100 of the AD&D Dungeon Masters Guide for example) and see if you can reconcile them. Push yourself a little, expand your mind to think about how the character would act and talk, and keep practicing.
To paraphrase Williams's character Parry, "I really miss him, Jack. Is that okay? Can I miss him now?"
If you haven't seen The Fisher King, I suggest you do so. Here's an article that explores it in light of Williams's death.