I'm not sure it's even possible to switch targets mid cast sequence the way that you're doing.

How about something like this:

/target focus
/assist
/castsequence lightning bolt, healing wave

By using assist, friendly spells should go to the focus and dps spells should go to the focus's target. I'm at work so I can't test this out, but I hope it helps.