I definitely would expect Trump to calculate whether it is more in his interests to do it before or after election day.
I don't think it's possible to remove the election math, though. Whatever he does, it could influence voter turnout for both sides.
There's also the possibility that something about the election will be disputed and go to the Supreme Court (as happened with vote counting with Bush v. Gore in 2000). So Trump might decide he wants his appointee to already be serving before election day if he thinks that would be more in his favor.