Well, the examples you cite are of established and official recurring characters in the Trek-verse. Including those characters in a novel can't, by definition, be including your own Mary Sue.
Almost all the recurring canonical characters
were one-shot characters, who proved so popular that they began returning in new stories.
Had Janet Kagan written a second ST novel, she may well have been tempted to bring Evan back, by "public demand", although it seems like she deliberately gave the character an "out" so that other authors couldn't just toss her into their novels like that may have done with someone like Narahat the horta or Security Chief Ingrit Thomson.
A true Mary Sue character, as a glamorised, wish-fulfillment extension of the author into the narrative, wouldn't be someone other authors would pick up on, unless they planned to kill them off.
Ah, and no one has mentioned Specs, from "The Galactic Whirlpool". David Gerrold put himself into that novel, but it was a fun cameo rather than a Marty Stu. Specs has crucial information, but he's not "the star". Gerrold also put himself into the script of one of his TAS episodes (and was animated into it by Filmation), an action that Alan Dean Foster had some delicious revenge with in the "Log" adaptation, calling Gerrold's unnamed ensign "Hacker".
Ensign Hacker by
Therin of Andor, on Flickr