I regularly wake up in the middle of the night. I have a short series of simple yoga stretches that seem to calm my legs (I have restless legs syndrome), then I drink a glass of water and go back to bed. It almost always works. When it doesn't, I play a game of sudoku to switch my brain off whatever it's fixated on, and try again.
I hope it keeps working for me because I don't want to have to start taking RLS drugs like my mom does.
I'm a college student that hates relying on caffeine to keep me awake (although, that's not been the case lately since it's finals season...). So what I used to do on nights I stayed up late studying was take a quick 20 minute run around my neighborhood. After that, I'd be pretty pumped up and studied well.
The number one fail-safe method that makes me fall asleep? Reading in bed. Especially something boring. If I combine that with some Natural Calm magnesium, that'll pretty much knock me out.
So I guess I'd say no don't exercise if you want to fall asleep.
I would expect that for most people (certainly this is the case for me) exercise makes you more alert in the short term and more inclined to sleep in the long term. About 2-3 hours seems to be the safe limit for me.
Try isometric exercises before bed. In the 4 hour body, Timothy Fereiss discovered standing on one leg to failure each day cured his insomnia. I use wall sits an hour before bed on days that I take a nap (napping usually ruins my ability to fall asleep at night)and it has worked consistently.
I believe that this may trick the body into thinking you were walking all day, which is what you are designed to do. It also does little to heart rate.