simple soultion

Code:

function up() {
	while(height <= 1531 && !key_w) {
		height += 1.5*time_step;
		wait(1);
	}
}

function down() {
	while(height >= 256 && !key_s) {
		height -= 1.5*time_step;
		wait(1);
	}
}





"empty"