ummm...
Looks to me like the my.entity1 will never be null since you have several ships creating the flames.
Ive never used the command, and it may not work for what you want, but try looking at the exclusive_entity command.
From the manual Page 56:
"exclusive_entity will terminate all other functions started by my, i.e. the current entity, at their next wait() instruction."
If possible you could also put the remove me in the do_flame stuff, so when the flame stuff is done it removes the flame??
Brandon