here goes my advise in a nut shell...
Break the parts of the song up in to sections.
Hook, Verse, Bridge, Chorus and so on..
Then listen to each section and use the tap tempo button in project/insert tempo.
once you have determined all the different tempo changes write them all down.
Start a new project and use the insert new tempo feature. (this of course includes mapping out the beats of your song.)
trying to match a tempo to a pre recorded riff can cause a lot of issues especially with tempo drifting.
everything and I mean everything, every little riff can be mapped and often should be to keep consistent musical time frame.