I've looked around the site for anything related but i couldn't find any clues.
My take at it is that using the volitional form with と思う you're expressing your plans in the near future as in
you think you'll take your medicine then fall asleep probably said on the same day or even a few hours before doing the action.
whereas volitional form + と思っている you're expressing your plans probably a few years in the future
you're thinking about taking on the challenge of a full marathon next year and probably saying that you've been thinking of taking on the challenge is correct too because you're still thinking, probably haven't even started preparing for it or probably even still considering it?
I'm not really sure about this, it's just a speculation, is part of what i said correct?