In the King's Indian Defense, is 9...Kh8 playable? After elaborately detailing the imbalances, I've concluded that black needs to take advantage of his kingside space with ...f5. Therefore, the move ...Nd7 is completely justified (the author agrees with this).

However, I've also deduced that black's dark bishop is bad whereas white's has a powerful outlook on the diagonals c1-h6 and g1-a7 (after Be3, preparing c2-c4-c5). Therefore, ...Kh8 preparing ...Ng8, ...Bh6 is also justified. In case of f4, ...Bh6 is played anyway. Such a positional move is okay in a slow, ice cold position as this one.

Thus, I chose ...Kh8 as my second move. The author doesn't elaborate on that, only noting ...Nd7 or ...Ne8 as acceptably clearing the way for ...f5. Is ...Kh8 playable?
I don't know what does "playable" mean for you, but... even though 9... Kh8 isn't a losing move, it's just a waste of time. Even a greater waste of time is the suggested plan with Ng8 and Bh6.

Why? Because almost in every position there are more imbalances and you have to choose the most important. Let me explain it:

You've already listed two imbalances in your question: black's space on the kingside (it's actually the pawn structure that is pointing to kingside therefore creating some space for black) vs white's space on the queenside and a bad bishop on g7 vs a better bishop on c1.

There may be other imbalances in this position, but they're irrelevant to us. Now you have to choose which of these two differences is of greater significance.

Now comes the "master" part. I think it is actually the ability to judge the importance of particular features, that every chess position has, that makes the difference between an amateur and a master. Fortunately I didn't have to come up with my own judgement of this position because it is a well known opening and I have some experience in it.

The reason why 9... Nd7 is better than 9... Kh8 is the fact that black's play on kingside is more important than an exchange of your bad bishop. In this position it is simple: You can't ignore a whole pawn structure because of only one piece (while I was writing this I realized that this is probably just an explicit rule that won't help you in any other position, but... OK).

The 3 moves you would have given white for the queenside attack can be fatal for you.

I also remember a quote but don't know who said it:


  In King's Indian (this line) white's attack is usually faster, but black's attack is usually stronger, because he attacks the king.




Another (concrete) reason against 9... Kh8 is that after 10. b4 (white starts his attack) white can simply play Bb2 next and no exchange will be possible for black.



The final judgement: 9... Kh8 with the idea of Ng8 and Bh6 is a bad plan because black should concentrate his play on the white king.