how can i store which button was pressed last time among many...

After a certain number of writes, shift the storage position up in EEPROM 'til you get to the top, then rotate back to the bottom.