I know exactly how you feel. I am 7 months sober and I was going through the exact same thing. I felt like an idiot..for example, I couldn't even spell and I was always a good speller. I felt like I had no attention span or sense of direction anymore it scared me. I'll give you some advise my Dr gave me, take Multi-vitamins, B-complex and ESPECIALLY B-1 everyday. I kid you not, I FEEL SO MUCH BETTER, mentally that is.
Also, try Melatonin 3 or 5mg nightly, it really helps with the insomnia.
Let me know if this helps. GOOD LUCK!!!!!