Having gone through issues with sleeping since I was a child I would strongly suggest the sleep study.
I did the same thing...lay there for hours, finally fall asleep, wake up, fall back asleep...etc. I would only end up with a few hours of sleep each night and it was never good sleep.
Your sleep issue may not be as sever as mine was but I am now able to sleep all night long. I go to sleep around 11 or 12 and can sleep til 6 or so in the morning. It's amazing. Oh and I can sleep on my back now woo.
Really...get a sleep study. It may not be depression. Like you said you've had the issue for a while now.
BTW having a beer or two before bed is actually bad! It causes to the sleep issues. I found this out because I used to think if I had a beer before bed I would sleep better.