Hmm, sorry if I can't help with coding, but maybe the following concept can help:

I think, you always want to make VISIBLE/NOT VISIBLE the same parts of an entity. So maybe you make 2 entities. The first (main) entity is the part you never want to disappear, the second is the part you want to disappear (look for an exact overlapping in MED). Now you can create every tick the second entity and give it a same SKILL in model1 and model2 (maybe SKILL44), witch controlls the visible stuff.

FUNCTION fn_first_entity();
FUNCTION fn_second_entity();

DEFINE skill_visible, SKILL44;

ACTION my_action
{
.....
.....
.....
fn_first_entity();
}

FUNCTION fn_first_entity();
{
WHILE (ME)
{
ent_create(.....2.mdl, MY.X, fn_second_entity);
wait 1;
}
REMOVE(ME);
}

FUNCTION fn_second_entity()
{
MY.skill_visible = YOU.skill_visible;
VEC_SET (MY.X, YOU,X);
VEC_SET (MY.PAN, YOU.PAN);

IF (MY.skill_visible == 1)
{
MY.VISIBLE = ON;
}
ELSE{
MY.VISIBLE = OFF;
}
wait 1;
REMOVE(ME);
}

Don't afraid of the continual creating process, it's no problem (maybe make max_entites = 1000; for testing or something similar)! You have to do it one time and you'll see you can make a lot of phantastic tools with this concept!!