Doing that only using command would be possible, although not that simple, as you would have to :
-Detect if a player placed the block
-Detect the position of the placed block in the player's max block-placing radius (unless you place it using an egg or if it has custom nbt, you can not achieve that if there are similar blocks in range)
-Summon an entity/give a custom tag to the block so when it gets broken, its drop gets killed and the block would be replaced
The only thing for making that simpler is to find the easiest possible way to match your idea.
Could you tell a bit more about why you want to make such mechanic? A cooldown crate, building structure or something like that?