yeah, a while loop should be helpfull xD
you want to check the floor under the entity, so you have to set the temp vector to the position of the entity first before you can subtract a value from the z-coordinate.
action dummy
{
var distance_traced;
var movement_speed;
var targetPos[3];
while(1) {
vec_set(targetPos,my.x); // set the target positio for the trace to the my-position
targetPos.z -= 4000; // going 4k quads downwards
distance_to_ground = c_trace (my.x, targetPos, ignore_me | use_box);
movement_speed.z = - (distance_to_ground - 10); // 17 = experimental value
movement_speed.z = max (-35 * time, movement_speed.z); // 35 = falling speed
// here you have to move the entity: for example with c_move
wait(1);
}
}
consider that if the var distance_to_ground is 0 the trace didn't found anything and the entity have to fall although

take a look:
c_move()Why do you use WDL-scripts???