You are in for a real challenge!
Sonar, and every modern DAW that I've used, is somewhat married to the concept of linear, as in tape, as in there are seldom any mechanisms to do repeats and the like.
To be fair, it wasn't that long ago that doing this in a notation package was pretty grueling. That part has gotten much better.
I've attempted similar projects, and the best bet for me was to simply record the entire piece, which of course meant that I could not really vamp. Which is why I don't do this anymore<G>!
MTI and a couple other outfits have software specifically designed to this application. I don't know why, but they have not yet made it available to the public as a tool, although it is very cool, and you get the software as part of the accompaniment packages they license.
I have to believe there are tools out there, available to mere mortals, that do this.
Way back in the dark ages (before audio and plugins and all the other cool stuff we take for granted today) you could easily do this sort of thing in Texture and Bars&Pipes Pro, probably KCS too. Probably others as well.
Not trying to rain on your parade, it's just kind of a limit to the model they use.
Of course now I'm wondering if playlists might be twisted into working for this? Might have to play around!