Yeah, that idle switch does affect the mileage, it tells the computer to switch to an economy map because it knows/certifies that you don't need any power at this moment. Conversly, when you go WOT, the computer switches to open loop mode and gives you as much power as it can at the cost of mileage. Your best mileage will be under 60mph...over 60 and you're really pushing air needlessly.
That switch is obviously adjustable, make sure it's "making and breaking" at the right moment, otherwise replacing it does nothing!
The cap-rotor rule usually goes, "If you're doing wires and plugs, do the cap and rotor too, the idea being, so they can all grow old together". Think of it as a kind of "Hallmark moment".