Reset on count

Is it possible to make a rotation that resets on count of successful shots?

Example:

Marksman at 7.1.5 will want to fire the following:

Conservation rotation:
Sidewinders
Aimed Shot
Aimed Shot
Marked Shot
Aimed Shot
Aimed Shot

With Rebuild rotation of:
Sidewinders
Marked Shot
Aimed Shot
Aimed Shot
Aimed Shot

So, the question I have is can we have a rotation that says:

/cast Sidewinders
/cast Aimed Shot
/cast Marked Shot
/cast Aimed shot
/cast Aimed shot

Loop start 2
Loop end 2
Continue Count 2

To cause it to keep doing loop until it loops 2 times with successful casts.
As you already check to see if you have actually cast the spell, are you allowed to actually not iterate unless it’s successful?

You can put that into a single line /castsequence Sidewinders, Aimed Shot, Marked Shot, Aimed shot,Aimed shot

The only thing to watch is if Sidewinders for example needs 50 focus (I don’t have a hunter so making this up to illustrate) and you don’t have anything that generates focus it will never get to Aimed Shot

Sidewinders generates focus.

Aimed shot costs 50 focus per shot.
And Marked shot cost 30 focus per shot and requires a proc.

The theory is:
Sidewinders puts up vulnerability for 7 seconds
You Aimed shot til vulnerability is down to about 2 seconds. (With patient sniper next time you get ((7 - Time left) * +15%)+100%) damage to Aimed shots.

At about 2 seconds you need to fire off a marked shot to refresh the timer back to 7 seconds and then repeat the aimed shots.

Marksman only has 120 focus post 7.1.5. And our regen is a combination of Sidewinders (+40 focus) and natural regen (~12 focus per second).

So, you cannot quite afford to put it purely in a castsequence. It would more have to look like:

/cast [nochanneling] Sidewinders
/castsequence [nochanneling] Aimed Shot, Aimed Shot, Marked Shot
/cast [nochanneling] Aimed Shot

The no channeling is simply because if you hit barrage. You cannot afford for it to be cut short by the gs macro.