I know mugen's default turning is hardcoded but could you use this and noautoturn to override it? What would be the optimal trigger if so?
Though it's been a while, this is a helpful question to provide an answer to. This solution seems effective, though I don't doubt there might be a better one.
Taking a look at this example, if you wanted to code a redirect move you can prevent autoturn in the custom state, but not in your own common, with an assertspecial flag.
This is simply because the common uses a changeanim, not a changestate, for all turning actions:
[Statedef 0]
type = S
physics = S
sprpriority = 0
[State 0, 1]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0;Turn anim over
value = 0
trigger1 determines that if the animation that's carried over from the previous state is neither 0 nor 5, then it becomes 0
trigger2 determines that if anim 5 is playing and returns you to anim 0 when it's over
The result from that first example is the common trying to figure out where you're facing and then freaking out:



It is hardcoded, and in a way that requires multiple triggers to override everything.
What you will do is determine a variable in your redirection state ahead of time, like at time=0 or whatever you like. For me this is var(15), which equals 2 only because I'm using a floating assigner variable to save space. The stateno I'm working with is 850, but it can be whatever you wish.
After this you have to use three triggers in state 0 in your common (or an overwritten state 0 if you don't like working with a custom common):
This changeanim will be used to override the vanilla changeanim by confirming your variable is true, and the animelemtime(1)=0 will attempt to correct the turning immediately.
[State turn override]
type = ChangeAnim
triggerall = var(15)=2 && prevstateno =850
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && Animelemtime(1)=0;Turn anim over
value = 0
However, this will still give you a slight jitter as the first tick of the first frame of the turn animation will play; therefore, the turn here will act to override any sort of freaking out by flipping it immediately at time=0, the same time as the Animelemtime(1)=0. The assertspecial is helpful as a failsafe.
[State 0, AssertSpecial]
type = AssertSpecial
triggerall = var(15)=2 && prevstateno =850
trigger1 = time=0
flag = Noautoturn
[State 0, Turn]
type = Turn
triggerall = var(15)=2 && prevstateno =850
trigger1 = time=0
Here's the result.
EDIT:
forgot to mention that you should update the original turn changeanim to make sure your variable isn't on, here's the full state too (with some quick fixes)
; Stand
[Statedef 0]
type = S
physics = S
sprpriority = 0
[State 0, AssertSpecial] ;no forced turn by mugen
type = AssertSpecial
triggerall = var(15)=2 && prevstateno =850
trigger1 = time=0
flag = Noautoturn
[State 0, Turn] ;corrective turn for first frame of anim 5
type = Turn
triggerall = var(15)=2 && prevstateno =850
trigger1 = time=0
[State turn override] ;override anim 5 at the first frame
type = ChangeAnim
triggerall = var(15)=2 && prevstateno =850
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && Animelemtime(1)=0;Turn anim over
value = 0
[State 0, 1] ;original sctrl with variable exception
type = ChangeAnim
triggerall = var(15)!=2
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0;Turn anim over
value = 0
[State 0, VarSet] ;make sure to turn off your redirect variable
type = VarSet
trigger1 = var(15)=2 && time=1 && prevstateno =850
v = 15
value = 0
; the rest as usual
[State 0, 2]
type = VelSet
trigger1 = Time = 0
y = 0
[State 0, 3] ;Stop moving if low velocity or 4 ticks pass
type = VelSet
trigger1 = abs(vel x) < Const(movement.stand.friction.threshold)
trigger2 = Time = 4
x = 0
[State 0, 4] ;Are you dead?
type = ChangeState
trigger1 = !alive
value = 5050
ctrl = 0