All mental states are based on physical brain states. It should therefore be possible to change mental state by directly manipulating brain state. We attempt to do this today by means of psychotropic medication, but this falls far short of the theoretical ideal, where we could could edit individual thoughts, motivations, emotions and predilections. This will inevitably happen as we learn more and more about the brain and how it stores information, develop brain-computer interfaces, and ultimately replace part or all of the brain with equivalent or superior electronic processors.
Having the ability to edit the source code of the mind will change everything. For all our intelligence, we are still as much at the whim of our evolved animal nature - its pleasures and its pains - as our more "primitive" ancestors. If we had full control over this, we need never feel driven to do something we know intellectually or morally we shouldn't do, never feel boredom or irritation or frustration, never feel less than the desirable amount of enthusiasm for whatever it is that we think we ought to do or think that we ought to think that we ought to do. You feel guilty sitting around having fun when you know you should be out saving the world; so you edit your mind to make saving the world *at least as much fun* as sitting around is.
It has been argued that this sort of ability could be open to abuse, since it would be a simple matter to maximally increase your happiness at minimal effort, removing motivation to do anything constructive. However, there would be no reason to this if happiness can as easily be coupled to purposeful activity as to no activity. All else being equal, I would rather walk 100m for $50 than run 100m for $50, since I am naturally lazy and would prefer to do less work for the same reward. But if I thought the run would do me good, I could change my mental state so that I enjoy running more than walking: that way I get the money, the exercise, and the enjoyment of the exercise as a bonus.