I just read a three part series in the DC Comics version of Star Trek. See here. It's numbers 43-45, dated October-December 1987. Basically, it's a continuation of the Star Trek episode "The Apple," but it also alludes to "Return to Tomorrow."
In "The Apple," Kirk arrives with a landing party to the planet Gamma Trianguli VI, which is sustained by a computerized deity named "Vaal." Akuta is the high priest of Vaal, meaning he's the only person who has communication with him. The people exist to feed Vaal, which they do by giving him explosive rocks to maintain his power supply. In return, Vaal blesses the people with food and good weather. He forbids them to procreate, and he keeps them perpetually young.
But Kirk feels that Vaal is preventing the people from progressing, so (against Spock's advice) he orders the Enterprise to destroy the deity. The people then must chart a new destiny, one that isn't as reliable as what they had before, but which will entail a lot of struggle and growth, with newfound pleasures on the side.
The comics portray what happens twenty years later. Gamma Trianguli VI is now a wasteland. Two factions are at war: One is led by Makara, who (on the episode) learned from Chekhov about love and sex. He leads the group that likes what Kirk did. He has lots of children from various wives, and he maintains power through religious threats: "Remember that bolt from the sky that destroyed Vaal? Well, it will destroy you if you don't straighten up!" (my paraphrase).
The other party is led by Akuta, who resents Kirk for destroying the planet's deity.
Spock offers to go inside of Vaal to fix him. When Spock melds with Vaal, he shares with Kirk and the landing party who and what Vaal is. Vaal was built by the people of Sargon, who escaped a war-torn planet and colonized a number of areas (including earth). We meet Sargon in "Return to Tomorrow." Sargon's people make Gamma Trianguli VI into a paradise through a Genesis sort of device, and they construct Vaal to maintain order and prevent an Armageddon. Kirk then concludes that he was wrong to destroy Vaal, the people's only source of peace and tranquility.
I'd like to share some religious thoughts about this, but I've been looking at the computer a lot today, and I want to rest my eyes. To be continued...