This is a finding that keeps coming up, and I've certainly found it true in my life, but there's a significant chicken-and-egg problem in that depression frequently precludes the motivation to exercise, and if you don't already have a deeply-disciplined routine to overcome the lack of motivation, people won't do it. Exhortation to develop those good habits in the good times, I suppose.
Motivation is fleeting but routine persists. When there is something that you want to do regularly (exercise, doing the final boring part of some sideproject, cleaning the house...) you remove willpower from the equation and set a day and a time. For example, everyday from 18 to 19 I work on my sideprojects, or saturdays from 16 to 18 is house cleaning time. There is no question if I want to do it, it is set at that…
> Routine can be used for bad things but also for good things.
So your willpower causes such routines to work. Not everyone works that way. And not everyone not working that way has depression. I don't think one can generalise this to "routines will fix your depression".
> but after some repetitions your mind (and body) begin to get used
I also don't buy into that. A good counter-example is tobacco smokers. Some manage to quit the moment they decide they want to quit, with no substitutes. Others try with substitute and interestingly for many who try, that also works, but for some it does not. And some can barely ever quit smoking. And a lot of this has to do with how their brain works.
Matthew Perry spoke about that with regard to his alcohol addiction. People are different. I personally never started with smoking, for instance, because I never trusted myself to be able to (want to) quit again - so at the least I was consistent in this regard (plus also, because in our youth, so many others started to smoke suddenly, and I always felt it was a very stupid reason to smoke merely because others would do so, even at an early age. Their rationales would not be mine and I failed to see the point in adopting their positions and make them my position).