This was a planned event. Scotty had already set every system on the Enterprise to either be automated or controlled from the bridge. They had planned everything, and Scotty could have changed the code before they left. If they could have used the code, they wouldn't send the Excelsior after them.This seems entirely plausible based on how Kirk overrode the prefix code on the Reliant to shut down shields in Star Trek 2. I'm assuming that a ship has to be within "range" to activate such a program (it appeared that Enterprise effectively neutralized Excelsior during the theft) and perhaps no other ships were close. In addition, maybe Kirk had told Scotty to disable this program?
Is anyone aware if a starship has ever been controlled remotely? Kirk chose to remain on board the USS Constellation in order to pilot it into the planet killer (TOS: The Doomsday Machine). If such a remote control was available, couldn't the Enterprise have beamed Kirk over and controlled the ship remotely instead of letting Kirk steer it into the beast and beam out at the last minute?
In those examples it was dramatically necessary for the computer to be too damaged to control the ship ( see Star Trek XI ) , In fact the computer essentially flies the ship, the crew merely tellls is where to go verbally, via controls or even a PADD