Hopefully in the next few weeks you will start to have a clearer brain...but it took me months to start remembering things. I had to keep a diary and tick stuff off. It was the only way to remember things. I needed frequent rests...for up to 6 months. It's certainly not over in a few weeks.
I really think it's time to talk to your GP about the ongoing sleep issues. Sleep deprivation is like being drunk. Your reflexes and decision making are impaired. Emotions are more labile. And please please ensure you have your thyroid function tested.
I did have some counselling sessions which helped. I still have some sleep difficulties now when stressed. I feel stressed much more easily.
Practising minfulness techniques, breathing techniques can help.
Using apps such as "calm" you might find very beneficial.
And yes...you will at least get some sleep during surgery and subsequent pain relief.
Take care. Kath x