A best case scenario would be to calculate the change in potential energy, and subtract that from your capacity. This, would of course be assuming 100% efficiency. But would give you a starting point.

If there are several ups and downs, they should probably be calculated separately with the negative downhill delta being multiplied by .80 (or whatever regen efficiency you want to estimate) then summed.

So for 4000' (1220 meters) and a car with a curb weight of 1520 kg (plus a passenger of say 100 kg) this would be.

1220 m * 9.8 (m/s^2) * 1620 kg = 1.94 x 10^7 joules

There are 3.6 x 10^6 joule per kwh, so at least 5.29 kwh must be consumed to lift the car and a 100kg (220lb) passenger 4000'.

Assuming 21 kwh usable this means 1/4 of your range. If you think you can get 100 miles out of 100% charge on flat stretches and at that speed, then do it. Personally I haven't been able to get much better than about 85 miles - so I wouldn't try it without a fall back charge somewhere along the way.

Your mileage may vary.