Untested:

Click to reveal.. (The Code)
Code:
#include <acknex.h> // include for Pure Mode
#include <default.c> // default key functions

function ladder_event()
{
	if(you)
	{
		if(you == player)
		{
			my.emask = NULL;
			vec_set(my.skill21,player.x); 
			vec_set(my.skill24,player.pan); 
		}
		while(1)
		{
			proc_mode = PROC_LATE;
			vec_set(player.x,my.skill21);
			vec_set(player.pan,my.skill24); 
			my.skill30 = c_move(player,nullvector,vector(0,0,(key_w-key_s)*my.skill1*time_step),IGNORE_PASSABLE|IGNORE_PASSENTS|GLIDE); //move the player up or down
			if((key_s && my.skill30 < 0.1) || (key_w && (player.z+player.min_z) > (my.z+my.max_z+player.max_z))) //if the ground or the end of the ladder is reached,
			{
				break; //stop the loop
			}
			vec_set(my.skill21,player.x); //stores the new position
			wait(1);

			wait(-0.1); //prevent the player from triggering the event again and again when leaving the ladder
			my.emask = ENABLE_IMPACT; //make the ladder again sensible for the player
		}
	}
}

//skill1: ClimpSpeed 10
ENTITY* ladder = 
{
	my.emask = ENABLE_IMPACT;
	my.event = ladder_event;
	set(my,POLYGON);
	c_setminmax(me);
}

void main()
{
	video_mode = 9;
	video_depth = 32;
	video_screen = 1;
	//d3d_antialias = 4;
	//d3d_automaterial = 2;
	fps_max = 35;
	wait(1);
}