Your problem is that you are using the "my" pointer after you use ent_remove(my). This is the number one thing you have to be careful with about ent_remove. You can never access that entity via pointer again, because it no longer exists--so if you ent_remove(my), and then try to set my.skin, my.lightrange, my.ambient etc a few lines later, the engine doesn't know what you're talking about, because "my" no longer exists.

It looks like you assumed ent_create() restores the "my" pointer. Easy mistake. But it doesn't, unless you specifically set it.

my = ent_create(ghost, vector(-608, 1072, 780), ghost1);

OR

My recommendation is that you do not use ent_remove or ent_create at all. These commands are slow and make things unnecessarily complicated--like with the pointers thing I was describing above. It'd be easier to just set the entity INVISIBLE and PASSABLE for 15 seconds, so it looks like he's gone, without actually removing him. Save ent_remove for the times where he's really NEVER going to appear again.

One more thing, if you stick with the ent_remove technique, you may have to set proc_mode = PROC_GLOBAL at the beginning of the function, so the function doesn't end right when you remove the my entity.