Umm, that would be the parking brake light switch... I can tell by the light green w/red wire going to it. The switch grounds the circuit when you depress the parking brake pedal, illuminating the light on the dash.
I checked the schematics, owner's manual, and did some reading in the service manual.
If the vehicle is automatically arming and locking itself, it's not the Ford OEM system. It may be a dealer-installed unit, but the factory anti-theft system does not auto-lock when it arms itself. Also, it sounds like the alarm unit is not playing well with the PATS system. Perhaps an intermittent bad PATS bypass module? If it was the factory system, inserting a recognized key in the door to unlock it would not set off the alarm. If, for some reason, the alarm was sounding, inserting it into the ignition and turning it to the accessory position should cancel the alarm. At any rate, as long as the key is recognized, the engine should start.
I think you've got a system other than the factory unit that's not playing nice with the OEM anti-theft system.
-Joe