If you want to use a loop for your entity the following pattern has proven to work just fine for me:
void my_event()
{
if(...) my.skill20 = 0;
}
action my_action()
{
...
my.skill20 = 1;
while(my.skill20)
{
do sth;
wait(1);
}
ptr_remove(me);
}
All code which is more complex than setting a few values should be delegated to your main loop like that.