I think it would have to be after the law. That leaves you with all the people that are already here. The solution: No immigration at all for five years. Let the country absorb them and make it manadatory that they go through the normal immigration process or they are deported. No welfare or bennies for that 5 year period.
Is a law that has been misinterpreted subject to Ex post facto restrictions. And Bill Clinton secured an Ex post facto law when he passed a retroactive tax increase in 1993’.