Flickering LED

Your over complicating this. And make your button default low and make IF statement look for HIGH.
If button is high, increment counter (global var), send to LED.

Else button is low, decrement counter(same counter as before, starting point for decrement), send to LED.

Set limits, if counter < 0, set to zero. If counter > 255, set to 255.

Easy.

Edit: add debounce if needed.