I also posted a question concerning the Oil Pressure SWITCH, different than the Oil Pressure SENSOR (Sender) that sends info to the Oil Pressure Gauge. My 1990 YJ has no Oil Pressure light on the panel, so I really don't know WHAT that switch does for the Jeep! In my case, the connector fell off the Oil Pressure SWITCH with no indication or operational effect. However...
On my 1990 YJ with a 4.2 6 Cylinder, the Oil Pressure AND Switch screw into a common block that itself is screwed into the engine block. There is no issue with proximity to the engine mount (See Photo).
I changed the Oil Pressure Sensor and it did not fix the same issue you have, that being high pressure indication (full needle deflection). I also connected (and disconnected) the oil pressure switch with NO effect on the oil pressure gauge.
My next step will be to measure two things... 1.) Check the resistance of the Oil Pressure Sensor (Sender). The gauge calibration is: 0 psi, 1 ohm, 40 psi, 46 ohms, and 80 psi, 90 ohms. This will verify the sender internal variable resistance,, and 2.) Measure the Oil pressure Sensor (Sender) voltage at the connector. Should be about 7.5 vDC. If not, the printed circuit board or the gauge is the problem. If you have 7.5 vDC, , replace the Oil Pressure Sensor (Sender).
I just shotgunned my issue and replaced the Sensor (Sender) without testing anything. It did NOT fix my high oil pressure indication problem.
Now, the Jeep XJ and MJ both have an oil pressure light and switch, so I don't understand why my YJ has the switch and connector installed. But to address your question is the following from the 1990 Service Manual, XJ & MJ section:
Oil Pressure Indicator (Light)
Voltage is applied to one side of the indicator BULB and the Oil Pressure Switch is connected to the other side. When Oil Pressure is too low, the switch closes providing a path to ground, and the indicator lights.
View attachment 120445