Additionally, Cognitive Behavioral Therapy has been huge for me. Since I was diagnosed late in life, I had just shy of 3 decades of bad habits to unlearn and replace with better ones. I still struggle with some things - punctuality, sleep schedule, for instance - but I'm far more productive and far happier.
Just a suggestion from an outsider (I'm not a programmer). What is your 'time constant' (like an RC circuit) in terms of getting bored? You mentioned a month up the screen. Can you get contract work on tiny projects that last less time than your 'time constant' and thus generate some income and give yourself time to see how the treatment goes?
I found out the hard way that the freelancing life did not work for me. Double booking clients on accident, forgetting deadlines, not being able to motivate myself to start projects, etc.
I certainly don't mean to project my experiences onto OP as fact, but ADHD often makes a lot of the skills that are required to run your own freelancing business very difficult to master and stay on top of, alas.
That being said, I think it's a really great suggestion if OP finds himself out of a job again. Especially if he can do projects serially and try not to overlap them. That's where I got myself into trouble.