Delay LCD backlight turn off

but consumes two pins of the Arduino

Do you have one analog pin available? You can use one analog pin as an input and output at the same time with some clever code. Basically you read switch as an input a few times a second, then switch it to an output for the rest of the time:

Sample code: (run this a few times a second in your main loop):

    digitalWrite(analogpin, LOW);     //turn off LED
    pinMode(analogpin, INPUT);    //change the pin to input
    backlightread = analogRead(analogpin);
    backlightread = analogRead(analogpin); //take a second reading to let the ADC stabilize
    if (backlightread >400) backlight = TRUE; else backlight = FALSE;        
    pinMode(analogpin, OUTPUT);      //change pin back to output
    digitalWrite(analogpin, backlight);    //write the current backlight status to the pin

one pin.png