Quite so. If you spend some time to improve your environment when you are on your "A-game" so to speak, it will not tempt you to do dumb shit when C-game time arrives. Everyone has ups and downs due to being tired or stressed, but how much they affect your life can definitely be improved.
The biggest impediment these days is ubiquitous, always-on Internet. In some ways I miss when it was a place you had to go (a physical desktop sitting somewhere) and something you had to decide to turn on (with some delay, so you wouldn't do it on a whim), as in the dial-up days.