The klingon ship, has just saved Kirk from the God Planet. They beam Kirk aboard and the gunner's seat slowly spins around to show who his savior really is... Kirk comes up and tries to hug him, hence the line as Spock "warns him off".
[Bird-of-Prey in space] SPOCK (OC): Klingon Commander. Someone wishes to speak with you.
(on the planet Kirk climbs to the highest peak while the malevolent being threatens him. Suddenly there is a burst of firing, from the Bird-of-Prey)
[Sha Ka Ree summit]
KIRK: So it's me you want, you Klingon bastards. ...What are you waiting for?
(Kirk disappears in a Klingon transporter beam)
[Bird-of-Prey transporter room] (two Klingons take Kirk to the bridge)
KORRD: Release him! ...Kirk, my junior officer has something he wants to say to you.
KLAA: I ...apologise. ...The attack upon your vessel was not authorised my government.
KORRD: Now may I present our new gunner?
KIRK: Spock!
SPOCK: Welcome aboard, Captain.
KIRK: I ...thought I was going to die.
SPOCK: Not possible. You were never alone. ...Please, Captain. Not in front of the Klingons.