okay, youre just right here

to calculate an offset(iam just doing the offset, bobing/shaking) will be yours ;))
we will simply set an offset and rotate it. here we go:
VECTOR Offset;
function DoCam()
{
Offset.x = -50;//50 units behind
Offset.y = 10; //10 units to the right
Offset.z = 50;//50 units up
vec_rotate(Offset, my.pan);
//now you can simply add this rotated offset to the player position to get
//the offset point. Your code should work if you do this(hopefully):
camera.x = my.x + Offset.x + fcos((camera.pan),cam_focus);
camera.y = my.y + Offset.y + fsin((camera.pan),cam_focus);
camera.z = my.z+6 Offset.z + fsin(camera.tilt,cam_dist);
}
Ofcourse you have to adjust my offset values to fit your setting

.
Hope this works, havent tried, just rewritten from Memories.
If somethings not working, fell free to ask.
Greets
Rackscha