To the best of my knowledge, it is not possible at the moment for the following reason:
We can’t programmatically set the bottom margin of a MasterPage.
We do not have access to the physical position of the cursor on the page ,allowing us to programmatically calculate if there is enough room or not, thus triggering the overflow.
Nope.
A master page is static and page margins are static as well.
As a work around one could think about nested tables with footer and subfooter in the most outer table to recreate the wanted feature. Just before pagination starts those footers are calculated and their sizes are handled as static during pagination. (Gives some strange output when a currency subtotal needs a line wrapping.) Only in a handfull of documents a work around could work.
Now remember that a Post Pagination Script, as the name state, is executed after the pagination process. That is why you will need to recall the pagination like this: