You are employable, and have no difficult responsibilities (kids, debt, etc), so honestly you are not in a bad position. Also, if you have not considered moving, I would. Psychologically it can make a huge difference to feel like you are starting over, somewhere new. If that seems hard, remember you can always move back. And don't let yourself come up with excuses for why it wouldn't work: it can work.
Write down the problem you want to solve first. Say, getting stable employment.
For this problem, write down a few optimal outcomes. For each outcome, write down what you would advise someone to do to accomplish it. For example, "I want to move to Seattle and get a job at Amazon" (or whatever). Now write down what you would recommend: "Research Seattle; Find acquaintances there; Figure out Amazon's job positions; Social engineer your way into talking to an Amazon employee (probably not hard on this site); Convince them that you would be a good engineer for them".
Now the hard part: Follow your own advice from above. Wake up every day, and step-by-step work towards your goal. If you are worried you cannot, find someone to make you accountable (parents, etc) that you can talk to about it.
Good luck.
You're in your mid-30s, no house, no car, no wife and experience in one of the most saught after and well paying professions in the world! Nothing holding you back from living the dream.
You've got money coming in from your consulting gig, but maybe that isn't what you want to do. You've got a good grasp of the english language, but you mention 'nothing put away for medical', so I assume you're in the USA. I'm also assuming, since you're on HackerNews, that you're interested in start-ups and working on cool tech.
I've got many friends from different parts of the world who would die to be in your shoes. If I wanted to move to the US, I'd be dying to be in your shoes too.
If you're not in one of the tech-hubs now, why not move? It costs too much to move? Companies will pay your moving expensive. Moving to a new city is hard? You bet it is, I've done it twice in the last two years, but what have you got to loose. You can be miserable where you are, or miserable somewhere else.
I recently started reading How to win friends and influence people[1], by Dale Carnegie and already after 4 chapters it has changed how I think about how I interact with people. Get yourself a copy of this book and read it.
[1]: http://www.amazon.com/How-Win-Friends-Influence-People/dp/06...
I'm 32 and in debt (fortunately my country provides for healthcare and has mandatory retirement money set aside), and I'm in a company with a toxic environment (like you said your old one was).
Yet I don't think I'm in a bad position, and I don't think you are either - as others said: we're in a well paying profession, with almost no unemployment. You're not tied to a city either (no emotional attachments).
If you're making customers happy, I'm pretty sure you can make more money. A good and reliable consultant is worth it.
I'd take it as an opportunity to reshape my life and realize my goals (if you don't know what those are, to find them out :) ). If I were you, I'd use the opportunity to be adventurous. Do you like traveling and startups? There's for example Startup Chile - http://startupchile.org/ .
You can travel with very little money by US standards too.
I'd try to meet people - is there a HN meetup or similar where you live? Meeting people face to face will probably help. Or if you have some kind of interest outside programming, meet other people that share those.
I think you have to change your mindset. If you think your life is terrible it's going to be terrible. Take things one small step at a time. As humans we're impatient and what to see immediate results. But that never works. It's more important to make consistent progress over time.