The switch is for the gauge cluster that has just the oil light. The sending unit is for the cluster that has an oil pressure gauge. You want the sending unit. Also remember that some sensors from the auto parts stores are cheaply made and bad right out of the box. I've had good luck with RockAuto.com as well as dealership sensors.
If you replace the sensor and still have problems I'd suspect the gauge is bad. Check with a mechanical oil pressure gauge first to verify your pressure. They are easily rented from autoparts stores and screw into the fitting that the sensor goes in on the block.
Same thing has been happening to me for a few months, but I haven't done anything about it. When I start my XJ, it goes straight to 80. When driving, it stays at 80. Sometimes when I idle, it goes to a little above 40 (where it used to always be most of the time), and then shoots right back up to 80 when barely hitting the gas. I'm guessing it's the same problem as you.