I'm not sure, if I understand anything, but you could try the code like this, because in your code the camera's position is always set to the player's position after the wait, means a tick later than it should:
action player()
{
while (1)
{
if (key_w) c_move (my, vector(15*time_step, 0, 0), nullvector, GLIDE);
if (key_s) c_move (my, vector(-15*time_step, 0, 0), nullvector, GLIDE);
camera.pan -= mouse_force.x * 1.5;
camera.tilt += mouse_force.y * 1.5;
camera.x = my.x;
camera.y = my.y;
camera.z = my.z;
my.pan = camera.pan;
my.tilt = camera.tilt;
wait (1);
}
}