How did the doctor come to this conclusion? You are right to be worried. Did he do lots of tests, and question your son to the nature of his headaches? I would have thought he would have sent him to a peadiatrician first, don't you? Which doctor was this? Your own local doctor?
How did he come to the conslusion that this was a chemical imbalance? I would get another doctor to look at your son, before I gave him the medicine.
I would seek a second opinion on this! Not until they have ruled out all other causes should they even be looking at a "chemical imbalance" as the cause or medicating him for anything. If no other reason is found, then it may be anxiety related but I would be very, very cautious about medication at his age. Better to address anxiety at this age with therapy, not meds. Have you had his eyes checked? I personally would not allow my child to be put on this medication and you are correct in questioning this. Is this a child psychiatrist doing this? I would definitely get a second opinion here. Don't go any further with this doctor! I wish you all the best and take care.