No Star Trek starship has ever demonstrated a fixed succession of command below the level of Second Officer. We might just as well decide that no such structure exists in Starfleet - or then that the structure does exist for situations where the top thre officers are all incapacitated in the long term, such as in wartime, but that it has no applications in peacetime where the top three officers peacefully leave the bridge to perform other duties. Since we never see a wartime situation where all three top officers would be lost, the second explanation is still quite possible.
One should note that the issues of who is left in command of the bridge and who succeeds the First Officer in command are two completely separate things. Command of the bridge is traditionally given to junior officers when the top dogs have better things to do (such as eat lunch or play some Command&Conquer in their cabin), since it is such a mundane and indeed menial job. Said junior officers are supposed to be capable of taking over even when the situation is dire, too. This situation is emphasized today when warships tend to have two separate centers of command: the navigation bridge is unlikely to see even a glimpse of the top officers in combat, as these officers will be down below in a well-protected, windowless room full of monitors and designed for giving a good situational view - something the window-ridden navigation bridge cannot do.
Starships do not have separate command centers outside the navigation bridge, to be sure. Thus, whoever is left in command of the navigation bridge is likely to walk the ship through any upcoming battles, too. Yet if the skipper and the XO are anticipating a battle, they would be badly remiss in their duties if they left the bridge for any reason.
Trek is unfortunately unrealistic in this respect: the top officers do leave the ship on occasion, even when fully expecting that their ship will soon see battle. This is not quite as common as one might think; a typical plot has the CO and XO leaving the ship, and the ship-endangering crisis only develops after this. But contrary examples also exist. And in those, it's Scotty who gets the conn... Sulu or Chekov only commands when the crisis develops
after his getting the center seat. (The movies excluded, of course.)
I think Scotty fills the role of second officer. In "A Taste for Armageddon" he retained command, not handing it over to Sulu, even though the situation was clearly a combat-possible one.
To be sure, if the ship is facing a battle, the last thing it needs is a rapid change in the command structure. One does not "hand over" a responsibility that has been burdened on one by the skipper. One isn't
allowed to. (See Duane's book for more on that.) If Kirk says that Chekov has the conn, and goes to talk with the Bugomites, and the Bugomite battleship then attacks, Ensign Chekov does not hand over the conn to Lieutenant Commander Scotty, or Commander Spock, or Admiral Hornswoggle, or President of the Universe Kaiser H. King. He issues orders to those people. And they obey, at least on matters pertaining to the running of the ship.
Timo Saloniemi