Haven't found a solution to fix the bugs yet, but I've got something else. In my advanced state_hunt, enemies can't get through doors, I've fixed this. Add:

code:

MY.__TRIGGER = ON;
MY.TRIGGER_RANGE = 16;


to the action of your enemy.
Now make skill7 of your doors 20 and the enemy opens the doors.
You can adjust the values if necessary.

Escape is a useless function I think, because what's the use of the enemy escaping to another room or even if he does it really good, escaping to the end of the level. In other games you don't see these either, for example Half-Life.
About your state_hunt, that might work, but I don't think it's easy to make. For example a enemy hits a wall on the left side of a opening and goes to the left, what should he do then when he hits the corner? Should he walk around the room, with a chance that he goes to another opening. Or maybe you can let him go the other way until he finds the opening, but what if there's no opening in that specific wall. And should he always keep walking into the players direction, because what if the players goes to another direction. You see there are a lot of problems, but if you can overcome this problems it might be a good state_hunt. The only way to find this out is to try it.

Iblis: off course your terrain-pathfinding won't work for A4, but I will be glad if the entity-pathfinding works for A4.