This should be asked in the Skript discussion.
First of all, you need the Skript plugin. Don't know what it is? It's an English-based programming language for Minecraft. Java for dummies, essentially.
What you need to do is create an on break: event, set {_b} to event-block, set event-block to bedrock, wait a few minutes, then set event-block to {_b}
Those are actual syntaxes, by the way. Good luck.