Give this example a try, it should help you in solving your problem (btw. why is there a wait instruction in your removal function and do you only call the latter once?):

Code:
void main()
{
	fps_max = 60;
	level_load(NULL);
	var i;
	for(i = 0; i < 100; i++)
	{
		you = ent_create(CUBE_MDL,vector(50+random(200),random(100)-50,random(100)-50),NULL);
		your.skill1 = i%2;
	}
	wait(-2);
	you = ent_next(NULL);
	while(you)
	{
		ENTITY* you2 = you;
		you = ent_next(you);
		if(!you2.skill1) ptr_remove(you2);
	}
	wait(-1);
	you = ent_next(NULL);
	while(you)
	{
		ENTITY* you2 = you;
		you = ent_next(you);
		ptr_remove(you2);
	}
	wait(-1);
	for(i = 0; i < 100; i++)
	{
		you = ent_create(SPHERE_MDL,vector(50+random(200),random(100)-50,random(100)-50),NULL);
		you = ent_create(CUBE_MDL,vector(50+random(200),random(100)-50,random(100)-50),NULL);
		your.skill1 = 123; // only remove cubes
	}
	wait(-2);
	you = ent_next(NULL);
	while(you && i > 50) // i == 100 at start
	{
		ENTITY* you2 = you;
		you = ent_next(you);
		if(you2.skill1 == 123) // remove half of the cubes
		{
			ptr_remove(you2);
			i--;
		}
	}
}



"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends