Try this version:
Sequences['ShadowSTpwnage'] = {
StepFunction = [[
limit = limit or 1
if step == limit then
limit = limit % #macros + 1
step = 1
else
step = step % #macros + 1
end
]],
PreMacro = [[
/targetenemy [noharm][dead]
/console Sound_EnableSFX 0
/cast [noform] !Shadowform
]],
'/cast [target=player]Power Word: Shield',
'/use 13',
'/cast Mind Blast',
'/cast Devouring Plague',
'/cast !Cascade',
'/cast Mind Spike',
'/cast Shadow Word: Death',
'/cast Shadowfiend',
PostMacro = [[
/startattack
/cast Fear Ward
/script UIErrorsFrame:Hide();
/console Sound_EnableSFX 1
]],
}