I don't believe it's possible to implement something like this. As Mojko often states, "Continuous effects are not supported."
I don't think it would be very useful, anyway. If someone were preparing a large attack, in most situations they could simply delay it by one turn. Also, if you had any amount of wall to begin with, you'd be sustaining wall damage after the fifty is taken back anyway.
Interesting idea, in any case.