The first thing he asked Scotty was why the Enterprise's transporters weren't working.
Exactly - and that is why he went to Scotty in the first place, to accuse him of everything that was not going smoothly with the impossible assignment. It's the classic "leadership by arrogance" approach that Kirk practices throughout the movie (even though the writers try to convey that he would be practicing it only for the first half).
So presumably he would've beamed right to the ship if it had been feasible to do so.
...Feasible by means vital for the upcoming mission. When those means were lacking, Kirk needed to get things straightened out, and that meant going to Scotty.
You just don't barge onto somebody's ship
...But you can beam into somebody else's transporter room just fine, even if that somebody isn't running his own machinery right then. Remember how people arrive at Kirk's or Picard's starship? Even when coming from a fellow starship
. And how they depart? Even when going to a fellow starship
. Nothing should stop Kirk from beaming into the Enterprise
transporter room. Or, if the room was in fire or something, then into the mess hall, merely with an advance warning that the mess hall was to be treated as the transporter room in terms of protocol.
There's IMHO no point in treating Kirk's route to the ship as the most efficient one, or the one dictated by regulations, or other such nonsense. Kirk wanted to see
his ship, and he would probably have faked a Klingon attack in order to do so; going to curse at Scotty on the space station was simply the most efficient way to accomplish Kirk's true goals, which included a private discussion (and a chance to gloat) with the Chief Engineer, a good long scenic route to the ship, and a moment to work out the anxiety of it all, now exacerbated by the hiccuping transporter machinery.