Help with simple code please!

The trick is to keep track of when you are in "motion detect mode". Look for IR input every time through loop(). Act on the input depending on the mode:

    if (results.value == 4294967295) { //any button is being held down
      if (InMotionDetectMode) {
        InMotionDetectMode = false;
        Serial.println("Motion Detect Mode off!");
      }
      else {
        digitalWrite(relay, LOW);
        Serial.println("Relay off!");
      }
    }