That's really easy if you're already using acceleration and the rel_dist part of ent_move.
Since you rotate the model you rotate the movement direction with the model by using rel_dist.
To avoid this, just rotate your speed vector in the oppsing direction that the character turns to let the movement direction stay the same even if the character turns.
How to do this?
This is your acceleration vector where you store your current speed:
MY._speed_x/y/z
Now you'Re doing somthing like this:
MY.PAN += MOUSE_FORCE.X * 5 * TIME; (for example)
Turn it into this:
TEMP = MOUSE_FORCE.X * 5 * TIME;
MY.PAN += TEMP;
VEC_ROTATE(MY._speed_x, vector(-TEMP, 0, 0)); // Rotates the speed vector into the opposiong direction
VEC_SET(TEMP.X, MY._speed_x);
VEC_SCALE(TEMP.X, TIME); // Time correction
ent_move(TEMP.X, NULLVECTOR);
Done!