Re: Kirk was promoted to Admiral right after the 5 yr Missi
According to the novelization for TMP (Star Trek: The Movie the book, lol) he was given an automatic promotion to Rear Admiral, mostly to keep him out of trouble. Being that he was the only ship captain to return from his five year mission with his ship and command crew in tact, that sort of made him a hero in the publics eye. Starfleet couldn't risk sending him back out there to put himself in harms way, basically because it would be bad press. So they gave him a grand, honorary title that keeps the rope around him so he can't leave Earth for any logical reason. After his successful voyage into the V'Ger cloud, again, he was a public hero. This severely weakened the brass' possition. But being that we see him as, again, an Admiral in TWOK, it's entirely possible that he was bumped back down to military education for reasons unknown.
Perhaps it was a personal choice. We know that Kirk left Starfleet for a time, (established in Generations) and it's widely speculated that it was after TMP that he took his leave of absence. But, since the Refit Enterprise was the right old age of 12 by the time TWOK came around, it's entirely possible that Kirk took his sebatical after a five year mission on the new Refit E. We know that pretty much the entire crew retired themselves to Academy duty, so it's entirely possible that the Enterprise was under the care of another crew for a while.
Kirk finally decides he's had enough of retired life, and decides he wants to rejoin Starfleet. This time, instead of being a hero, however, he becomes a teacher, to mold the minds of the future and to rejoin his comrades. The Enterprise is returning home after yet another five year mission after being in the custodian of another crew. Kirk, of course, has followed the career of his old gal since he had retired (heros are often privy to quite an extensive network of info) and offers to rejoin as an instructor at the academy under the condition that he be allowed to train his cadets aboard the now 10 years old Refit Enterprise. Of course Starfleet leaps at the idea of having one of their most heroic and brilliant tacticians training and molding the future minds of the fleet. They agree and this so follows up into The Wrath of Khan.