Add this function into your script to get WASD (or change it for other buttons) input that is smoothed out based on the direction of the input. It interpolates between directions instead of sharply jumping from one to the other for more natural movement.

Code:
var inputrot[3];
var inputs[3];
function getWASD()
{
	var moving;
	var temprot;
	inputs[0] = (key_w - key_s) + joy_force.y;
	inputs[1] = (key_a - key_d) - joy_force.x;
	inputs[2] = 0;
	moving = vec_length(inputs);
	vec_to_angle(inputs,inputs);
	
	
	temprot = inputs[0] - inputrot[0];
	temprot = cycle(temprot,-180,180);
	if(abs(temprot) > 2) inputrot[0] += sign(cycle(minv(temprot,360 - temprot),-180,180)) * time_frame * 20;
	vec_set(inputs,nullvector);
	if(moving) vec_for_angle(inputs,inputrot);
}


Ideally this function would be called once per frame in the player action. Access the directional input from the global vector "inputs"