Star Trek: The Animated Series offers a quote from King Lear late in its run. Earlier, it provided two near quotations.
The first is based on a speech from 1 Henry IV. Falstaff says, "The better pat of valor is discretion, in the which better part I have sav'd my life" (V.iv.119-21). Kirk's version is the usual paraphrase: "Discretion is the better part of valour."
Kirk also modifies Polonius' "Though this be madness, yet there is method in't" (II.ii.205-06), giving us "There is a method to this madness” in place of the more cumbersome phrase:
And the idea that The Enterprise is seeking revenge makes the entire episode into a Hamlet derivative!
Well . . . not really. But you can see how easy it is to get carried away.
Links: Shakespeare and Star Trek Complete.