I was having quite severe insomnia when I was younger and it all cleared around the time I was diagnosed with ADHD and prescribed stimulants. My insomnia doesn't seem to return when I'm on holidays or during weekends, periods which I usually don't take any medication.
I asked my doctor about it, and he said it could be related, but it could also just be that I grew out of it, or any number of other reasons. He did say that some doctors was been experimenting with very low doses before going to bed with various degree of success. But it was a high risk that these people was suffer from some kind of undiagnosed variant of ADHD or another where insomnia typically is a comorbid disorder, like bipolar disorder.