I can not see why you should get a crash in your script. You'll get an error message though: in development mode, the engine detects that you try to display the name of a removed entity. The release version would just display nothing.

If you remove an entity, it's still in the entity list, it just is not visible anymore and has no name or other properties. It only gets physically removed from the list at the next garbage collection, which happens at the end of every cycle.

So the easy solution is to check if the entity has still a name:

Code:
while(you!=NULL) {
	if(you->type == NULL) break;
	...



Hope this explains the problem.