The scene with Will Smith and Jay Leno was filmed during Smith's appearance on Episode #3.164 (1994).
John Ridley appears as himself, playing a comedian who is scheduled to appear on The Tonight Show with Jay Leno (1992). Ridley is not actually a comedian, nor did he ever appear on Leno's show. He is, however, a screenwriter, having written 12 Years a Slave (2013), and two episodes of "The Fresh Prince of Bel-Air", among other things. He wrote the episodes What's Will Got to Do with It? (1994) (S5E2) and Soooooooul Train (1994) (S5E8).