OK, let me give you a nudge
This code reads the sensor value into a variable:
long sensorValue = capSensor.capacitiveSensor(30);
So now you only want to react (and turn the LEDs on / off when you RE-touch it.
So you need to know the previous state and toggle it.
Let's assume that this statement results in a TRUE result:
if(sensorValue > threshold)
So now the lights need to be either switched on or off. How do we know which it is to be?
We need to declare a new variable (I would suggest a boolean) outside the loop() and outside of the setup() methods (this makes it 'global', i.e. available to everything in the code):
bool LEDState = false; // start with assuming LEDs are off
Now, after that 'if' statement above you can check: I want to turn them off if they are on and vice-versa:
if (LEDState==true) {
digitalWrite(ledPin, LOW); // Turn off LEDs
}
else {
digitalWrite(ledPin, HIGH); // Turn on LEDs
}
Finally, you need to toggle the LEDState flag to the opposite of what it is now:
LEDState = !LEDState;
which means whatever the LEDState is now, reverse (or flip) that true/false value. You don't know (or care) what it is, just set to the other value. The exclamation mark means 'not' which can be read in English as 'the opposite value of'.
Finally, add a reasonable delay at the end of the loop() method to give you a chance to remove your hands otherwise it will flash on and off very quickly indeed (far too quickly for you to react)!
delay(1000); // milliseconds = 1 second
Given that I'm writing this on-the-fly without my IDE handy I'm really hoping there are no errors in the above but try it out and see how you get on. If you get problems post the entire code here so I (or others) can have a look,