I'm guessing something like this.
Code:
Vec_set ( vecTarget, hit.x);
Vec_set (temp_vecA, player.x);
Vec_set (temp_vecB, vecTarget);
Vec_sub (temp_vecA, temp_vecB);
Vec_nomalize(temp_vecA, 20);
Vec_add (vecTarget, temp_vecA);
//Now vecTarget "should be" 20 units off the wall and closer to the player.


Other solutions could be putting the camera in abox. Using side traces from the camera. Using 3 traces to the wall and blending the vecTarget further to the open side. Or hiring a virtual monkey to fly the camera in the dangerous isolation of 3dgs space!!!