My GS macros seem to sometimes work and sometimes not

Hi all I am working on trying to figure out this new GS addon I am a multiboxer and I was very very glad for sequence macros and now i am just scratching my head. in these coming macros i will explain what I have and what I hope to obtain, now all these macros are basic and I will slowly add on to them as I level but right now this is what I have/want.

Sequences[‘SSHADOW’] = {
StepFunction = [[
limit = limit or 1
if step == limit then
limit = limit % #macros + 1
step = 1
else
step = step % #macros + 1
end
]],
PreMacro = [[

]],
“/castsequence [nochanneling]reset=target Shadow Word: Pain, null”,
‘/cast Smite’,
PostMacro = [[

]],
}

+WANT+
This is my Shadow priest level 6 so using smite right now, I basically want him to SWP a target and then smite until target dies or a new target is added and he SWP’s again.

+HAVE+
Right now it seems to be working exactly like I want it to but sometimes does not and just smites mostly any input would be awesome

Sequences[‘SRET’] = {
StepFunction = [[
limit = limit or 1
if step == limit then
limit = limit % #macros + 1
step = 1
else
step = step % #macros + 1
end
]],
PreMacro = [[

]],
'/cast Judgment',
    '/cast Crusader Strike',
PostMacro = [[

]],

}

+WANT+
Now this macro for my Ret right now I want it to judgement whenever it can higher priority over CS

+HAVE+
I think I set this up right so far but let me know if I did not

Sequences[‘SMMH’] = {
StepFunction = [[
limit = limit or 1
if step == limit then
limit = limit % #macros + 1
step = 1
else
step = step % #macros + 1
end
]],
PreMacro = [[
/petattack
]],
‘/cast Arcane Shot’,
‘/cast Steady Shot’,
PostMacro = [[

]],
}

+WANT+
I am looking to have this macro right now set up so that my hunter spams arcane til he cannot and then steady shot’s when he cannot Arcane shot

+Have+
I know for a fact this does not work as I have seen my hunter at 75 focus steady shot

Sequences[‘SPROTW’] = {
StepFunction = [[
limit = limit or 1
if step == limit then
limit = limit % #macros + 1
step = 1
else
step = step % #macros + 1
end
]],
PreMacro = [[

/cast Shield Wall
/cast Charge
]],
‘/cast Victory Rush’,
‘/cast Heroic Strike’,
PostMacro = [[

]],
}

+Want+
Pretty much same thing I am looking for priority that he will Victory rush when he can over a HS

+Have+
Not sure if this is working or not seems to work sometimes and not others any input would be nice on if I got this right.

Sequences[“SDESTROLOCK”] = {
PreMacro = [[

/petattack
]],
‘/castsequence [nochanneling]reset=target Corruption, null’,
‘/cast Shadow Bolt’,
PostMacro = [[

]],

}

+WANT+
Pretty much the same for my lock as Shadow priest i want him to corruption everytime a new target is selected otherwise Shadow Bolt for now

+Have+
seems to work pretty much the same as my SP’s macro with sometimes just Shadow Bolting.

Sorry for the long post I realize this is a lot to ask the reason they are so small is I want to make my own macros from the ground up and share to others when I can explain exactly how I worked the macros.