Have a collision only detected once

I am having some issues with collisions and the way that the code is firing. I want the collision to be detected and then execute the following code once. Unfortunately, there is contact between the objects at multiple points which results in the code firing more than once. My code is set up to remove the node before the code is run but I am still suffering this issue. How can I ensure that a collision will be detected at a single point or that the code will only be run once, thanks in advance.