Yes, exactly.
Another way this can work is for the external situation to get bad enough that changing one's habits, however unpleasant, still feels like an improvement over the status quo. I'm told recovering addicts call this "hitting bottom."
In my own case, this happened a couple of years ago when I suffered a stroke... the status quo was no longer remotely tolerable; I had to change my habits (both mental and physical... they aren't cleanly separable).
The end result was a much better baseline mood than I had before the stroke, which still seems an implausible win.
Still, on balance, I suspect that your approach was way better. :-)
I like this way of talking about "hitting bottom"... as if it's just reality doing the priority-setting work for you, but if you were a little smarter, you would have done it for yourself. I have found that thinking of "hitting bottom" as a prerequisite to getting better is SPECTACULARLY counterproductive; but until you said that, I didn't have a compact alternative (besides just not thinking that way, which works about as well as not thinking of bears).
This is a supplement to the luminosity sequence. In this comment, I mentioned that I have raised my happiness set point (among other things), and this declaration was met with some interest. Some of the details are lost to memory, but below, I reconstruct for your analysis what I can of the process. It contains lots of gooey self-disclosure; skip if that's not your thing.
In summary: I decided that I had to and wanted to become happier; I re-labeled my moods and approached their management accordingly; and I consistently treated my mood maintenance and its support behaviors (including discovering new techniques) as immensely important. The steps in more detail:
1. I came to understand the necessity of becoming happier. Being unhappy was not just unpleasant. It was dangerous: I had a history of suicidal ideation. This hadn't resulted in actual attempts at killing myself, largely because I attached hopes for improvement to concrete external milestones (various academic progressions) and therefore imagined myself a magical healing when I got the next diploma (the next one, the next one.) Once I noticed I was doing that, it was unsustainable. If I wanted to live, I had to find a safe emotional place on which to stand. It had to be my top priority. This required several sub-projects:
2. I re-labeled my moods, so that identifying them in the moment prompted the right actions. When a given point on the unhappy-happy spectrum - let's call it "2" on a scale of 1 to 10 - was labeled "normal" or "set point", then when I was feeling "2", I didn't assume that meant anything; that was the default state. That left me feeling "2" a lot of the time, and when things went wrong, I dipped lower, and I waited for things outside of myself to go right before I went higher. The problem was that "2" was not a good place to be spending most of my time.
3. I treated my own mood as manageable. Thinking of it as a thing that attacked me with no rhyme or reason - treating a bout of depression like a cold - didn't just cost me the opportunity to fight it, but also made the entire situation seem more out-of-control and hopeless. I was wary of learned helplessness; I decided that it would be best to interpret my historically static set point as an indication that I hadn't hit on the right techniques yet, not as an indication that it was inviolable and everlasting. Additionally, the fact that I didn't know how to fix it yet meant that if it was going to be my top priority, I had to treat the value of information as very high; it was worth experimenting, and I didn't have to wait for surety before I gave something a shot.