entity* monster;The second action requires the monster pointer being already set. However this depends on whether the first action was started before the second - and there's only a 50% chance. It is not defined in which order the actions assigned to entities are started at level loading. Replace your second action by:
action become_monster { monster = MY; // set a global pointer, that can be used by other functions }
action get_monster_height { my.z = monster.z; // use the pointer to set my vertical position to the monster's }
action set_monster_height
{
while (monster == NULL) { wait(1); } // wait until there is a monster
my.z = monster.z;
}