<!-- Just ignore my rambling if you've solved it on your own. -->

Ah, wall-walking! Thanks for the screenshot.

I know how to work with a bunch of vectors here. This figures out a new "forward" vector for your character given an old "forward" vector, an old "floor" normal, and a new "wall" normal that you can get from c_move (untested):
Code:
var tempang[3];
var tempang2[3];

// in a function...
// figure out how the old normal needs to be rotated to change to the new normal
vec_to_angle(tempang, OldNormal);
vec_inverse(tempang);
vec_rotate(NewNormal, tempang);
// you could reuse tempang here but I used a different variable because it means something different now
vec_to_angle(tempang2, NewNormal);

// rotate the old forward vector the same way
vec_set(NewForward, OldForward);
vec_rotate(NewForward, tempang2);
// ...rest of function


The hard part is turning the new forward vector into an Euler angle. Using vec_to_angle would give you the right pan and tilt, but then you'd have to adjust roll.

You could easily figure out top and side vectors (top = NewNormal; left = NewForward CROSS NewNormal) if that info is needed. I've never had much luck converting vectors to Euler angles, though.