After Sandra Bernhard's breakthrough performance in the 1983 film The King of Comedy, Hollywood could no more deny her talent than figure out what to do with it... at least until now. Tonight's Will & Grace finally casts her in the role that she was born to play — herself!

"[In the plot] I'm selling my apartment, and Will and Grace want to hang out with me, so they make a lowball offer," she tells TV Guide Online. "Then it turns into a temporary friendship that ends badly."

Ironically, the actress-singer-author — whose latest one-woman Off-Broadway production, The Love Machine, closes this weekend — owes her new guest spot to an old pal. "Jhoni Marchinko, one of the [sitcom's] big writer-producers, kind of created the episode for me," she reveals, adding with a laugh, "I think it will be a good showcase — I mean, I'm playing Sandra Bernhard!"

Although the onetime Roseanne semiregular spent decades researching her Will & Grace alter ego, she refrained from ad libbing. "They wrote the part, and I let them," she insists. "I really didn't want to be myself."

However, should she ever get the chance to star in her own series — and she's eager to — she has some specific ideas about what a 21st-century Mary Tyler Moore ought to be like: "An independent, fun character who'd be a good role model — but edgy, sophisticated and sexy... like me," she says wryly. "Maybe when everybody in TV land comes to their senses..."