Well you can buy headache medicines (at least here) with added caffeine, usually marketed as XYZ plus, Parcetamol and Aspirin, and the caffeine is supposed to increase the potency of the analgesic. I've no idea what the mechanism is - possibly it acts as a vasodilator and as you say, speeds the blood flow.

I've found an extra strong cup of coffee takes care of my headaches. I'm up till four AM but my headache is gone.

In short, chocolate has much less caffeine than does tea (3% dry weight of tea leaves) or coffee (1.5% by dry weight of coffee beans) whereas cocoa beans are 0.2%. Milk chocolate has much less caffeine than does dark chocolate. (You'd have to eat about a pound of milk chocolate to get the same amount of caffeine as is in a cup of coffee.)

While dark chocolate has more, people eat less dark chocolate in a single sitting than they do milk. The richness of dark chocolate encourages people to eat less as does the lack of sugar. (Sugar creates "sugar craving" causing people to eat more and more.)

Chocolate also contains a substance called theobromine that is chemically related to caffeine and has similar affects on the body. (Theobromine is not nearly as strong as caffeine and the affects are slightly different so one should not infer that they are.) The fact that chocolate has both of these chemicals tends to confuse people for some reason.

Excedrin has a nice dose of caffeine:
acetaminophen 200 mg, aspirin 250 mg, caffeine 65 mg
So a dose, 2 tablets, is like a cup of coffee.
One reason for a headache can be caffeine withdrawal. I read (in Science News I think) that a doctor had published a paper to remind doctors that caffeine withdrawal might be the cause of headaches for people in the hospital for some other reason.
In an interesting bit of marketing, all the Excedrin varieties, regular, back, migraine, are all the same formula. They just went to the trouble of proving that it worked for those uses, so the FDA lets them put a special label on it.

I would like to bring attention to the fact that these blogs numbers on caffeine are wrong. As someone who suffers from hypertension and kidney disease, the amount of caffeine content (and other alkaloids) is incredibly important and
plays a major impact to my health.

Scientific published studies show caffeine content in raw cacao/cocoa powder is approx 0.1-0.4%. This equates to 28.3mg of caffeine in raw cocoa/cacao @ 0.01% and 113.2mg @ the 0.04% range. The reason for the range is noted
in the study referenced below, Maria del Rosario Brunetto, 2007, which states:
"it is also important to highlight that studies carried out by Davrieux, Assemat, Boulanger, and Cros (2004) showed the existence of a relationship between the methylxanthines content with the cocoa's genotype."

That study is also posted below.

To put this in perspective, that means that 1OZ of 70% cacao Dark Chocolate (at 0.4%) equals 80mg of caffeine. Thats like drinking 2 Coke's, or more than 1.5 cups of black tea. That means 2OZ of chocolate equals 160mg of caffeine
at 0.4% content levels (the maximum levels measured by genotype). Thats more than a cup of coffee!!

Please be aware that most sites are publishing false information not on purpose, but because there is a echo chamber of false information spread on decentralized information systems like the internet, where all information flows
freely and without censure. I am contacting all the sites via administrators or by posting in comments to prevent the misunderstanding of the information portrayed by blogs/stores/etc on the caffeine content in chocolate.

There is a study in 2001 from Pura Naik that I cannot find a publicly posted pdf for that is referenced. Only paywalled at scientific journal pay for access sites. If anyone else can find it please let me know. Its beyond sad that our
public funds research into the health of humanity that is then sold to private entities for profit, restricting the public from freely accessing the information they subsidized through their own labor.