I think the suggestion of having a mantra or slogan or rule that you hold yourself to is great. I think its best to just walk away if you take a bad beat or out drawn and you feel yourself heading towards tilt.

I don't think enough of us take as many breaks from the game as we should. I'm starting to follow a schedule that is similar if I was at my desk job. Taking 15 min breaks here and there, etc. Its helps my mood considerably.