You need to do something like this :-
if (analogValue < lowerthreshold) {
pressed = true;
else {
pressed = false;
}
// then you need to see if it has just become pressed with something like
if( pressed == true && lastPressed == false) { // it has become pressed since last time
// now do the stuff you want to do when the thing is touched.
}
// finally at the end of the loop function put
lastPressed = pressed;
With both pressed and lastPressed being global variables.
However:-
there is a safety margin in the values stored where there is nothing happening to prevent crazy floating action lines 6 and 7
You can't do this successfully as there is no way to distinguish between a reading got from a floating input and one got from a touch or release.
Also, the level of help you are needing shows that you are not yet ready to tackle this sort of project. You need to do a lot more examples that are contained in the IDE, and understand them, to get your code skills up to speed.