Heres an IDEA to think on... it may work, it may not.
But seeing as you have a project to test it in, it will be easier for
you to test than it is for me.

Make a new SPHERE_MDL entity (PASSABLE & INVISIBLE) that surrounds the
existing planet, with the same origin point.
Do a c-trace from your Vehicle OUTWARDS to hit the new sphere.
The HIT struct now contains info about that hit, that means that the
HIT.nx,ny,nz contain the NORMAL of a perfect sphere at the point your ship is
touching it...
You may be able to use that normal to calculate your angles.
I suspect something like this...
...
vec_set(Vehicle.pan, hit.nx); //set to same as captured normal
vec_rotate(Vehicle.pan, vector(90,90,0)); //rotate vector to pan/tilt/roll orientation (needs tinkering)
vec_to_angle(Vehicle.pan, Vehicle.pan); //convert from direction-vector to angle
ang_add(Vehickle.pan, vector(desired_pan,0,0)); //rotate to desired pan
...
BTW. This calculation does NOT need to be done IN the entity... A temp vector will do..
Best of luck dude... Your in a hairy area...