Feasability: "disabling" a pushbutton while code is running

Can be something like this?

Try things out to see what happens.