Its not clear when you stopped the drugs but the symptoms could still be due to drug withdrawal, or from continueing effects of the drugs. There may be some persistent cognitive changes which could be picked up by formal neuropsychological evaluation. Hopefully these will improve as you stay off drugs.
Inhaling mold could conceivable cause a chronic pulmonary infection, but this is best evaluated by a pulmonary physician and is unlikley in the absence of pulmonary symptoms (cough etc), and pulmonary tests.
Aflatoxins are produced by fungi and are usuallu associaetd with liver disease.
I would suggest a headache neurology opinion for your headache and a neuropsych eval for the cognitive complaints.
Good luck