The key reason companies can and do pay SWEs relatively well is that these SWEs generate large profits for them.
That's the "opportunity cost" GP mentioned: yes, you'd have to pay the SWE $400k, but the cost of not employing them is several times that in lost profit.
Moreover, I'm not really seeing how the barrier of entry is going to increase substantially. In fact, it will probably decrease.
As software eats the world, there will be more and more "pure software" work, which means your only toolset is your knowledge. SWEs with large amounts of specialized knowledge and skills will increasingly be able to compete in these areas (security is a pretty good example). It doesn't have to be your typical company with a logo, brand, and office space - we're talking about consultancies and virtual businesses.