"If Google Code succeeded, it’s hard to imagine that Google would not have tried to monetize it someday."
Google code did succeed in that sense. It had hundreds of thousands of 30-day active projects, and some insane market share of developers.
I don't honestly remember if it was even shrinking when we decided to stop taking in new projects.
I doubt we would have monetized it directly (IE sell an enterprise version) - the entire market for development tools is fairly small.
In 2022 it was ~5 billion dollars, and future estimates keep getting revised downwards :).
CAGR has been about 10-14% in practice, sometimes less.
I don't remember if it's still true, but most of that 5 billion dollars was going to Atlassian (80% at one point).
Now, if you project backwards to 2006, and compare it to other markets google could be competing in, you can imagine even if you got 100% of this segment it would not have actually made you a ton directly.
Indirectly, eh, my guess is you still make more off the goodwill than most other things.
It's actually fairly rare to make any significant money at development tools directly.
Nowadays, the main source even seems to be trying to sell AI and productivity, rather than tools.