Yes, the second part of that tutorial, Keys explains how to check on a scan.
If you have to call it directly then set my to the proper entity and call the function, or pass the entity to the function. The function or action that an entiy runs in not attached to or part of the entity it is a global function.
For instance in your example something like this might work.
code:
entity* door_entry;
entity* player;
function open_entry_door()
{
door_entry = ptr_for_name("door_enter_hall");
player = ptr_for_name("player1");
if (player.flag1 == 1)
{
slidedoor_event_z(door_entry); //open door
}
}
}