To me it sounds like your main issue is understanding your diagnosis of bipolar and keeping its symptoms under control. You are not crazy! Bipolar is an eminently treatable disease I asked my friend who is a physician with 25 years in the field and she recommended going back to see a doctor to look at some alternative medications. At this point lamotrigine, valproate and lithium have validated efficacy and can help with the symptoms you describe. I'd suggest a second medical opinion!
Regarding your coding interviews, I would suggest leaving them until after you start feeling in control. Practice, targeting your resume (500 applications is a lot!) and staying calm will get you a comfortable position with your experience IMO.