Interesting that The Laertian Gamble
wasn't Robert Sheckley's first brush with Trek. It was great the way TOS recruited big-name prose SF authors to write episodes. I wonder why hardly anyone ever does that anymore. I guess because TV shows these days are generally so staff-driven. And it does sometimes happen to some degree; Stargate Universe
had John Scalzi as its science consultant, though I don't think he ever wrote an episode.