I suggest that you think about how you could market yourself. What are your top three features that would make you particularly attractive to an employer? Are there specific application domains where your experience would make you more valuable than less chronologically advanced people? Make sure that you have taken all of the modern steps to create an online presence, e.g., LinkedIn. Unfortunately, for many people who have been out of work for a few years, and especially for older people, it's hard to build a strong case for yourself over someone who is willing to work > 60 hours/week and who is more current in terms of technical skills and job history.
It's much easier to find a tech job with a government agency (local, state, or federal) than it is to find a job in industry. Government jobs are publicly posted, and governments are especially sensitive to various laws regarding equal employment opportunity; there's also a higher percentage of older employees in governments than you will find in most companies. There's something positive to be said for a steady 40-hour/week job. While I don't think much of certifications, some government job postings include them, in which case it would be worth pursuing that certification for a specific position.
If you enjoy teaching, you should consider finding a way to teach at the college level. Community colleges and university extension programs often need instructors, and there are numerous for-profit institutions that don't require advanced degrees of their faculty. While teaching itself can be personally rewarding (not so much financially, though), many of your students will be working for companies that might be willing to hire you as a contractor or perhaps even as an instructor for the company's internal education programs.
In summary, be realistic about what you can bring to the party, recognize that many companies simply find legal ways not to hire people over 40, and focus on those opportunities where you are on a relatively even playing field in seeking a job. Good luck.