I don't think this will work. When you stop pump above, you will leave this state, so you will never get into the if condition below. I think the 1 second delay and check for occlusion should be handled in the SelfTests.c.
This is part of an ongoing investigation on how to fix the slider touch margin issue. I am still working on it. It worked somehow for the slider with lower resolution but for sliders, with a high resolution, it causes a handler jump which makes it less user-friendly. Added clarifying comment.