I'm a huge John Mulaney fan - like, seriously a HUGE fan. I've seen every one of his specials at least 8-10 times, and can quote large portions of them word for word, beat for beat, tone for tone. I absolutely think he's the greatest comedian working today, and for my personally, my favorite of all time.
HOWEVER, I'm not so sure he'd be good at writing a book to a musical. I could see him doing lyrics, but not the book.
The thing is, because I know his specials so intimately, I also have a sense of what he's NOT so good at. You may not notice it the first, or even second time watching his specials, but he's not all that good at structure, and he's especially awkward with segues and transitions. He has a hard time coming up with ways to go from one topic to another, and so he often comes up with really awkward ways of linking them. And his shows, unlike someone like, say, Mike Birbiglia or Hannah Gadsby, don't have much of a cohesive arc or structure to them. Even "Oh, Hello" which I think is hilarious, is a bit haphazard and messy from a structural point.
My worry is that if he were to write a full book to a musical, it would have dialogue that's absolutely hilarious, but it would come at the expense of the cohesiveness, the structure, the logical scene order, etc.
Still, if he does write one, I'll be first in line for tix!