The only Star Trek actors people I'm aware of who wrote an episode are Walter Koenig and Robert Picardo. Walter Koenig wrote 'The Infinite Vulcan' from The Animated Series and Robert Picardo has a story by credit 'Life Line' from Voyager. Are there more actors who wrote an episode, maybe even for other shows?
Majel Barrett co-wrote DS9's "The Muse." And if we're including movies, Leonard Nimoy had writing credits on The Voyage Home and The Undiscovered Country, William Shatner on The Final Frontier, Brent Spiner on Nemesis, and Simon Pegg on Beyond.
With all the above examples, maybe actors should stick to acting (or directing, or producing, but not writing.)
The first three examples are people who started out both writing and acting. It's harder to find examples of people who started out as only actors and then became successful writers later.
Carrie Fisher, Emma Thompson, Molly Ringwald, Amber Benson, that guy from BUFFY who became an Oscar-winning screenwriter. And let's not forget Shari Lewis.
Some actors are also excellent writers. However, not all actors should be writers. Several of the episodes & films that were mentioned above were incredibly weak, in my opinion. That's why I leave it to the professionals.
There are plenty of actors whose skills do not extend to writing, and plenty of writers whose skills do not extend to acting, and plenty of actors who can write well and plenty of writers who can act well. Suggesting that it is inappropriate to produce a script that is clearly sub-par merely because its author is an actor with some clout is perfectly fair. Suggesting that there's a particular correlation between being an actor and having sub-par writing skills is unfair and ignores the numerous writer-actors that have enriched our culture. Including, I might add, that most famous actor who tried his hand at writing, a certain Mr. William Shakespeare of Stratford-Upon-Avon.