I'm not sure why you insist a Mary Sue has to be a guest star, since even the original Mary Sue was the star of the fanfic story that originated the term.
But wasn't she the guest
main star in a Star Trek fanfic, with Kirk Spock and McCoy the regular players? Or did Paula Smith write all of her ST fanfics about the girl?
The term "Mary Sue" comes from the name of a character created by Paula Smith in 1973 for her parody story, "A Trekkie's Tale" published in her fanzine Menagerie #2. The story starred Lieutenant Mary Sue ("the youngest Lieutenant in the fleet — only fifteen and a half years old"), and satirized unrealistic "Star Trek" fan fiction.