Issue number 15 of Gold Key Comic's Star Trek comic book dated August 1972 featured a story
entitled "The Museum at the End of Time." The comic story was written by Len Wein and its plot was very similar to an animated Star Trek
episode "The Time Trap" which aired a little more than a year later on November 24, 1973. "The Time
Trap" was written by Joyce Perry. (Picture of the comic book cover, 52K JPEG).
In the comic book story, after traversing a cosmic storm, the Enterprise and a Klingon Battle Cruiser find themselves in a timeless netherspace called "Limbo." In this limbo are dozens of spaceships that were reported missing over the centuries from races all over the galaxy. The inhabitants tell the newcomers that there is no way out, but the Federation and Klingon vessels eventually break out of limbo by cooperating. Even though the way out had been discovered, limbo's inhabitants weren't interested in leaving. Once free, Captain Kirk and the Klingon ship captain communicate and decide that it would be foolish to cooperate one minute and try to kill each another the next. So the two ships go their separate ways.
This is essentially the same story as "The Time Trap" in every important detail. It appears that this 1972 comic story formed the basis for one of the Animated Star Trek's more interesting episodes. The situation is similar to how several Batman comic stories were dusted off and made into scripts for the live-action Batman television series of 1966-68.
What is interesting, is that Mr. Wein's contribution was not credited as the basis for the episode's story as Larry Niven was for "The Slaver Weapon."
A much more detailed synopsis of Gold Key Star Trek Comic #15 can be found at my Guide to the Gold Key STAR TREK Comics web site.