Hi Ian,
The door lock key operation is a mechanical connection to the latch linkage operated by the electrical lock actuator, so there is no electrical connection to the keypad. Since the key fobs can lock and unlock the doors the lock mechanism seems OK. Sounds like a key is broken off inside the lock and preventing insertion of your key. You can see the exploded view of your car's locking mechanism in the link in the following paragraph and how it is attached so you can remove the lock cylinder and have a better chance of removing the broken key or whatever.
The keypad is connected to the Driver Door Module (DDM) by wires and they could be corroded from water penetration causing a bad connection to the DDM. You would need to remove the driver door trim panel to check the connections. We have a procedure that shows how to remove the door panel on a 2005 Town Car (same as 2007 model) in our Lincoln Tech forum here:
http://lincolnforums.com/forums/threads/10480-Town-Car-door-panel-removal see post #3 for the pdf version. That document also shows the lock cylinder and how it is attached to the door handle for removal and the latch for unlocking. If all is well with the electrical connections on the keypad and the DDM located forward of the keypad in the driver door (3 electrical connectors) then check the functions of the DDM:
1. Memory seats, outside mirrors and adjustable pedals settings are in the DDM (using the SET 1 or 2 buttons) and sent to the DSM (Driver Seat Module) to execute;
2. Seat easy-out feature uses memory positions in DDM and executes them through the DSM based upon key in ignition switch read by the LCM (Lighting Control Module);
3. Trunk lid release and power opening module are activated by DDM from the switch;
4. DDM controls the door locks and remote keyless entry;
5. DDM controls the door ajar switches to communicate to LCM;
So are any of those functions not working that may suggest DDM failure?
Attached are procedures for replacing the DDM and the keypad which will help locating them and removal to check etc.
Good luck.