I implemented this, and it works, but it doesn't handle speed as well and even regular sprinting can outrun it, causing you to drop a block occasionally. Any ideas? The easiest solution would be to make it a 3x3 ring of armor stands around the player, which is why my original can handle a comparably large amount of speed. The barriers also don't disappear properly, which I think is because by the time the command goes into effect, the player is no longer in a place where the barrier would get erased. Just a theory, I'll do some more testing tomorrow.
Edit: Even if this is properly implemented, barriers would still vanish behind you if you walk on them. I'll be reverting this unless anyone has a way to make this work.