You might need to debounce the button, otherwise the code may see a pile of on/offs for every press, depending on the button or sensor.
If you're real tricky, you can have a lit led for a sensor that when you cover it with your finger acts like a button. It takes more code than to debounce a pushbutton, will only move if you make it able to move and won't work in the dark but otherwise is kind of neat.
When you say led blink, there's mainly 2 kinds here.
The first is that while the led blinks, nothing else happens. Even the button will not respond.
The second is BlinkWithoutDelay where you can make other things happen "at the same time" the led blinks.
The second, BWD, is one of the Examples sketches in your IDE, the first one in the 02.Digital sub-menu.