I think you may be insufficiently fearful of the current and future economy. Or maybe I'm just too fearful. But I grew up rather poor, and while I thankfully learned to shed most of the proletarian work ethic that keeps poor and working-class people in economic shackles (that is, the political mindset, perceptions of character, and in particular the kinds of labor considered meaningful), I still believe that the prudent economic life demands a constant hustle.
My financial advisor says the average cost of a 4-year private education will be well over $350,000 in less than 20 years. (It'll be that in just a couple years for the elite private schools, including non-Ivy League elites where most students don't get much aid.) Now, I don't plan on paying for my son to attend a private university if we can help it (public undergrad is fine by me), even though we might be able to swing it without too much damage, but that number serves to really drive home the cost of keeping your family securely middle-class.
Also, yes, middle management is always an escape. OTOH, middle managers are always the first to get the axe during layoffs. I probably misinterpreted the original question, but moving to middle management is not something I aspire to. I respect it, but I'm not a people person and I don't like managing people. I've been fortunate that the few people I have managed I was able to hire myself, people who I felt were much more self-motivated and self-directed than the average engineer.
If I can't continue hacking for an income, I'll probably return to the law.
I left it unsaid, but IMHO ageism is rife in the software industry. There'a ageism in almost every industry (including the law, it's just reversed ;) but IME it's comparatively greater in the software industry. Many people won't bother even denying it, and aren't afraid to excuse it.
I saw ageism even when I was in my early-20s, working with an original Amiga veteran (a bone fide historical figure in the Silicon Valley) whom other young engineers would constantly deride, arguing he was too "behind the times" and just "didn't get it". It was all bollocks of course, and I understood that. (Though I never completely understood why he chose to stay in the trenches, and continues to do so AFAIK, despite the fact he could probably join a VC firm.) Now that I'm older and approaching grey beard status (an age which decreases every year), I won't let myself forget the mentality among the junior engineers, as well as the bean counters, recruiters, and other managers who not only tolerated it, but enabled it.
In light of the ageism, if you want to continue hacking, and you want to minimize your risk of income volatility later in your career, you have to constantly dedicate yourself to improving the depth and breadth of your knowledge. That's a good idea in any industry, but especially in software. And that's why I don't see coasting as a viable option.
But people's situations and preferences vary, of course. Coasting can make more or less sense, depending on context.