single button 5 pushes lock and auto sleep after 10 secs

Hi everyone! I built an electronic cigarette with an arduino pro mini and a mosfet and it is working great so far... obviously much has to be done and at this stage i want to merge a 5 button pushes lock unlock function and an autosleep after a certain amount of seconds. The button is also on pin d2 so i think i can use an interrupt to wake the thing up when i push the button while sleeping, but it should work if it is not locked and not if it is locked. do you have any suggestion on how to approach this?
Thank you!