I believe you are certainly not the only one. Changing "tasks" into habits greatly helps to achieve your goals. I recently read an excellent book about habits called "The Power of Habit" from Charles Duhigg. I sincerely recommend reading it.
And for the OP, thanks for posting and sharing your ideas. I can relate to many of the things mentioned in the post. Especially for the anxiety part. It does not matter what you are coding, as long as you code something. I've solved some problem's from Project Euler and after each exercise I've felt a sense of accomplishment and restful.
1. http://www.reddit.com/r/IAmA/comments/1ujvrg/jerry_seinfeld_...
I guess that's the threshold of the internalised habit.
For my personal situation I can't guarantee I would get time to do coding every evening but 2 session a week seems feasible.
I run every two days. The chain is still a chain, but it's just a slight more distributed one.
I printed a calendar and stuck it on my wall. Then I just mark it off with a big circle when I finish a run, or a cross when I fail.