I used the a/b = 1+9s to give you an estimate, where a = speed (m/min) on flat ground, b is the speed on a hill, and s is the slope as a decimal (ie 2% is .02)
This rough estimate gives you a slope of 2.5% that you should set your treadmill to.
As you pointed out, there are a ton of factors that impact how closely this simulates what you want. Not the least of which is how good you personally are at hills. Some people will "beat" the calculator, others will be way behind. Its a reasonably approximation for an average person.
Here is an excessively long thread about this with various suggested formulas:
https://www.letsrun.com/forum/flat_read.php?thread=197366