Could you pleaser attach your full code? Use code tags if possible:
{code}
//code here
{/code}
^replace above {} with [] so it looks like this:
I'm no expert in AVR on in any code in that manner but still, willing to help!
what I understood, is that you want led to turn OFF after 20 seconds?
If that's the case, what funtion buttons serve? Counter on/off and reset?
I'd do it so instead of counting seconds each time second has passed, I'd use Interrupt with timer registry with either overflow or compare-match method, which are then combined with timer interrupt....
IF timing is not issue/non-cricital, you could also use chip-timer (millis for example) and use switches with boolean status.
After writing this, I realized this is AVR, not arduino but oh well, those are still my cup of tea in this subject
...