I understood the essence of your problem correctly initially, and gave an answer (2nd post) to it.
Perhaps I was not detailed enough in details.
This mod uses the map generation parameters:
height_limit / width_limit - these are special limiters in the game, which are set by the parameters in the world generation height / width. They mean that there is literally nothing above / below +-x / 2 or +-y / 2, most likely even the chunks themselves are not created there. And this mod uses these parameters to determine what is above / below if there is pollution, then it must be returned to the first chunk below / above this border.
The "ribbon maze" mod works differently, it generates the most ordinary game map in size, without height / width restrictions, then according to the algorithm, this mod fills the necessary chunks with a surface type called "void".
But these chunks remain completely playable in the game's opinion.
Therefore, in order to achieve the desired behavior, you need to create or find a completely artificial system for implementing the spread of pollution, I have already thought about creating it and I know that it is quite simple to do. This is your only way to achieve what you want.