A simple but not-so-nice way would be to set the object that is newly created to passable for about one second.
Otherwise you could set a skill to OFF when it is being created and wait for a second, then set it to ON. In the event check if this skill is ON or OFF and only let it react (and creat a new object) if it's ON.
Btw, I think your return(0); doesn't do anything. I did that same mistake once :P... it's in a "void" function, which means the function doesn't return anything, so calling a "return" statement in that function doesn't work.