So, you should first put up a system that switches from one behavior to another. You can use the "spawnflags" int variable to store it :
0 = initial lauche
2 = aiming for target.
The way you would switch between states can be decided by checking the "age" of the rocket. when spawned, I guess the frame number is stored in gentity->entityState->time. Then you just have to compare this number to the current frame in the game to get the age. Then if the age is over a certain number, you switch to the desired behavior.
For the spiraling rockets, the quaternions we talked about by email might come in handy to write a system that will be correct what ever the angle you're shooting at.
Basically, I would first generate a vec3_t angle, where the yaw and pitch are generated from the sinusoidal functions, yaw = sin(time) * scale ; pitch = cos(time) * scale.
sinusoids are cool !
Then you convert these angles to a quaternion, you also convert the absolute velocity vector (one that is stored and never modified, inherited from the moment the rocket was shot) to a quaternion, and you multiply (conjugate) the second by the first. This should update the velocity in a way that could make it look like it's spiraling.
Of course, I strongly advice you to put up some tests at each stage of the development to see if it works as intended ! for example, slow down the rocket speed, make the model bigger (in cg_ents.c), etc.
and of course, this is only a very vague idea of how I would make it, in the end there's all the work of plugging back the results of the math to the velocity and angle of the rocket !