Air density does have an effect, but the density change from temps that we've seen in the last few years (say a 75 degree game vs an 80 degree game) is only going to get you a couple feet of ball travel. While it make a difference on balls that just barely clear the fence, it definitely doesn't account for the entire boom in home runs.
For comparison, a ball hit 400 ft at Yankee Stadium (400 ft elevation) would go 440 ft at Coors Field (5280 ft elevation). That's a 10% increase in ball distance for a 17% decrease in density. Increasing the temp by 5 degrees F drops the density by 0.8%, which is probably only good for 1-3 feet.
https://chem.libretexts.org/Exemplars_and_Case_Studies/Exemp...