During the attack the turbolift system was overworked and backed up with requests.
At the same time, there is only one way off the bridge. The computer knows this and that the ship is at red alert. It also knows the captain and most of the command crew are on the bridge.
When Kirk signals he is leaving the bridge, his turbolift has to be prioritized despite them all being occupied and the nearest lift is rerouted.
It just so happens it was the lift the Scotty was using to take his nephew to sickbay with.
Or to add to this, Scotty knows a request to travel from the bridge to sickbay is going to take priority in an alert situation so travelled via the bridge to skip the queue.
Serious theory:
During the attack the turbolift system was overworked and backed up with requests.
At the same time, there is only one way off the bridge. The computer knows this and that the ship is at red alert. It also knows the captain and most of the command crew are on the bridge.
When Kirk signals he is leaving the bridge, his turbolift has to be prioritized despite them all being occupied and the nearest lift is rerouted.
It just so happens it was the lift the Scotty was using to take his nephew to sickbay with.
Or to add to this, Scotty knows a request to travel from the bridge to sickbay is going to take priority in an alert situation so travelled via the bridge to skip the queue.
I have a different theory.
Scotty knew this training shakedown was going to be easy times, so he got into the bottle of green stuff he keeps stashed in the intermix chamber.