It computes to me.
Shut down the border for as long as it takes Mexico to get its S together and deport the illegals on its territory and prevent entry. About six months in my estimate.
Cost benefit analysis. As a developer Trump has done tons of these. He knows what will make Mexico take action. I see this as an incredibly simplistic cause-and-effect action which is long overdue.
The economies of both the US and Mexico have a lot of cross border traffic.
The following link is to a dated article but it discuses some of the impact
between both economies. They are intertwined more than many may suspect.
https://blog.oup.com/2018/02/mexico-united-states/