Perhaps he was feeding lines from off-camera. Some actors prefer getting their cues from an actor rather than a script supervisor as non-actor's delivery can sometimes be pretty flat with little to play off for the featured actor.
Except the scenes being shot were in Gary's library and office. Doohan didn't voice the Beta 5, Barbara Babcock did. And the only scenes that had Shatner, Nimoy, Lansing, and Garr in Gary's office at the same time were the climactic scenes, and the Beta 5 didn't have any dialogue there except calling off the countdown. There was nothing for the actors to play off except "Altitude 250 miles" and "Forty seconds to impact," which wouldn't have been worth wasting Doohan's time.
Also, I checked the call sheet again, and DeForest Kelly is also listed as H for "Hold," while the other four actors are listed as W for "Worked."
I did some research and jogged my memory, and I've remembered what "hold" means. It means that the production isn't using the actor on that particular day of shooting, but isn't done with the actor yet, so they're still being "held" by the production. So the "hold" notation for Kelley and Doohan meant that they weren't on the set that day, but they still had scenes to be shot on a later day. Maybe they were supposed to stay available in case something delayed shooting on the intended set and they had to substitute shooting a different scene that would've used those actors.
When you see something that's unusual, like humans and Vulcans working on a ship together, it doesn't immediately follow that they're from the future. He wouldn't have known that they would someday be allies, that they would someday serve on starships together, and that those ships would have transporter devices...unless he did.
He wouldn't have
known for certain, but that doesn't mean it's particularly difficult to
hypothesize. He's a smart guy; it's not like he would've been totally unable to imagine an explanation.
But I went over the transcript, and I must concede it is explicit in the episode that Gary does have knowledge of the future. His full line in the transporter room was, "That's impossible. In this time period, there weren't -- Humans with a Vulcan? You're from the future, Captain." His use of "weren't" makes it pretty clear he's acquainted with thinking of the 1960s in the past tense. Moments later, he says of his employers' world, "Even in your time, it will remain unknown." That's not just a conjecture or extrapolation, it's a statement of certain knowledge.
So we can conclude that, while Gary was native to the 20th century, he and his employers did have direct knowledge of the future. Thus they undoubtedly had time travel in their repertoire.
Regarding Gary's device and the sonic screwdriver...I think both were drawing from a common source, the Bond phenomenon. IIRC, Our Man Flint (1966) had the title character boasting of the number of covert functions that his pen could perform.
Again, though, the sonic screwdriver was originally just a screwdriver -- or rather, a device that could open panels, hatches, and so forth. That's all it initially was -- not a multifunction spy tool, but essentially a high-tech prybar. (Crowbar to us Yanks.) Within a few months (in "The Dominators") it was given the ability to cut through a wall like a blowtorch. Its first use as a scanning device was in 1971's "Colony in Space," and by "The Sea Devils" a year later it became a mine detector/detonator. And so on.
So it wasn't created to be any kind of spy device; that came later, once Jon Pertwee became the Doctor and the show took on a James Bond/gadget-driven flavor. As originally conceived, the sonic screwdriver was just for opening things. Like I said, all the similarities we see to Gary's servo were added years later, rather than being part of the original concept behind the sonic.
(We can probably safely assume that the sonic keeps gaining more functions because the Doctor keeps tinkering with it and adding new settings. Which is why it's so ridiculously overpowered by his 9th through 11th lives.)