I agree with everything that Frank said about the code, but I would also add that if code is disappearing, please definitely report that as a bug. The bug report you sent about the code disappearing was closed for another reason, and I'll follow up with you in a direct message.
I think that the person who asked you to post it here just meant the question about the way the code worked itself, and not that code was disappearing on you. (It's nice to have code discussions in the forum because usually multiple people are having the same issues.)
Thanks for taking the time to write in and post.