I'm horrible at this as well. But I think I found a good way. I have a timer on my blackberry that I set for 15 mins. It vibrates on the 5 min and 1 min and end marks.
I focus exclusively on a task for 15 mins. Then at the end I reset it again, or move on to the next project.