Well as far as I know there are no raycast left or right commands which makes it awkward. I've tried this sort of method and it works slightly for me, but it may just be a glitch knowing me. It's only a method not the actual script, i guess you'll probably know what to do.
I assume your character plays the dive animation when shotdamage=1 so,
state(1?),shotdamage=1:rotatey=90,state(2?)
state(2?),racast 1,100:rotatey=-90,animate(left dive)
state(2?),raycastback 1,100:rotatey=-90,animate(right dive)
state(2?),raycast 1,100,raycastback 1,100:rotatey=-90,state(normal shooting)
Sorry if I didnt help you much but I hope you can see the idea I had. It may help it may not