How to get code-snippet to only 'loop' once?

Because you have:

    if ( UserStopPulseCount != 0 && ...

you could add this line inside it to prevent it from triggering again until UserStopPulseCount is set again:

        UserStopPulseCount = 0;