Before she can give her reasons and prior to the Enterprise reaching Qo'noS, the ship violently drops out of warp. Chekov has found a coolant leak in the warp core, and stopped the ship manually. They are still twenty minutes away from Qo'noS. Kirk recruits Uhura, who knows Klingon, to join him and Spock. He gives Sulu command for the first time, with orders to contact Harrison before they arrive to demand his surrender. Dr. McCoy is concerned, but Kirk is sure Sulu is up to the task. They use a vehicle they confiscated a month before, in the "Mudd Incident". Kirk orders two other officers, including Hendorff, to remove their red shirts and change into more casual clothing; they cannot have any obvious connection to the Federation on this mission, lest they start an interstellar war. Chekov assures Kirk he will try his best to repair the engines before they return.
Before the Vengeance can destroy the Enterprise, though, the Vengeance's systems are reset; Kirk immediately receives a transmission from Scott, who has sneaked on-board the Vengeance. It will take time for its systems to restart, so they have an opening to stop Admiral Marcus. Kirk puts Spock in command of the Enterprise. Spock is resistant to this idea, but Kirk insists the Enterprise needs somebody who "knows what they're doing" in command. Kirk heads to sickbay, and asks Khan about the Vengeance's capabilities. It is a Dreadnought-class, twice as big, three times as fast, and far more heavily armed than the Enterprise. At the same time, McCoy injects Khan's blood into a dead tribble to examine his blood's effects. Kirk asks for Khan's help, assuring him this will be his only opportunity to save his crew.
The writing of the film's script was initiated in October 2010.  The screenplay was driven by the notion that the members of the Enterprise's senior staff were slowly becoming an inseparable, if occasionally unruly, team of friends. Bryan Burk observed, "The script for Into Darkness started with one question: how can we put the Enterprise team into the greatest jeopardy and conflict?" 
Since J.J. Abrams wanted the script of this movie kept secret as much as possible, the film's screenplay was released to the cast very soon before the film was to enter production, the start date being in January 2012. (Star Trek Magazine Special 2015, pp. 20-21)  Whereas a writers' strike had prevented the cast members collaborating with the writers on the previous Star Trek film, this movie was significantly modified by the cast. "The script really changed in the weeks leading up to the shoot," Spock actor Zachary Quinto recalled. "We worked on it, talked about it, and rehearsed it, so things came out of that process that we weren't able to [add] the first time." (Star Trek Magazine issue 172, p. 39)
In June 2008, it was reported that Paramount Pictures was interested in signing producers of the 2009 Star Trek J. J. Abrams, Bryan Burk, Damon Lindelof, Alex Kurtzman, and Roberto Orci for a sequel. In March 2009, it was reported that these five producers had agreed to produce the film, with a script again written by Orci and Kurtzman (with the addition of Lindelof). A preliminary script was said to be completed by Christmas 2009 for a 2011 release. Kurtzman and Orci began writing the script in June 2009, originally intending to split the film into two parts. Leonard Nimoy, the original Spock who plays an older version of the character in the 2009 film, said he would not appear in the film. Abrams was reportedly considering William Shatner for the sequel.
By 2010, a release date of June 29, 2012, was set, with Lindelof announcing he had begun working on the script with Kurtzman and Orci. Pre-production was set for January 2011, although Burk said actual filming would probably begin during the spring or summer. Actor Zachary Quinto later said that these reports were untrue. Lindelof compared the sequel to The Dark Knight.
Lindelof said that Khan was considered a character they needed to use at some point, given that "he has such an intense gravity in the Trek universe, we likely would have expended more energy NOT putting him in this movie than the other way around." References to Star Trek II: The Wrath of Khan were eventually added to the script, but Lindelof, Orci, and Kurtzman "were ever wary of the line between 'reimagined homage' and 'direct ripoff'." Orci and Kurtzman said they wanted a film which would work on its own and as a sequel, not using ideas from previous Star Trek works simply "because you think people are going to love it". Orci noted that when trying to create the "gigantic imagery" required by a summer blockbuster, Kurtzman suggested a scene where Enterprise rose from the ocean. With that as a starting point they (and Lindelof) came up with the cold open in Nibiru, which blended action and comedy and was isolated from the main story in an homage to Raiders of the Lost Ark.
In an interview with Buzzfeed two years after the film's release, Abrams addressed some of the film's shortcomings. He thought that the dynamic for Kirk and Spock's relationship in the film "wasn't really clear." For keeping the identity of Khan a secret prior to the film's release, Abrams felt he "was trying to preserve the fun for the audience, and not just tell them something that the characters don't learn for 45 minutes into the movie, so the audience wouldn't be so ahead of it." In the end, Abrams recognized that "there were certain things I was unsure of [...] Any movie [...] has a fundamental conversation happening during it. And [for Into Darkness,] I didn't have it [...] [The problems with the plot] was not anyone's fault but mine, or, frankly, anyone's problem but mine. [The script] was a little bit of a collection of scenes that were written by my friends [...] And yet, I found myself frustrated by my choices, and unable to hang my hat on an undeniable thread of the main story. So then I found myself on that movie basically tap-dancing as well as I could to try and make the sequences as entertaining as possible [...] I would never say that I don't think that the movie ended up working. But I feel like it didn't work as well as it could have had I made some better decisions before we started shooting." 2b1af7f3a8