I've just started a topic with two sketches for LED Dimmer. Have a look and test one of two sketches. 1st one is based on Yours with a little change to save the last dimmer status after on/off. 2nd is basing on Dimmable Light sketch (using EPROM to save the status).
Good Luck !