From your description, I don't think the door lock is the most likely cause. Since the dishwasher sometimes doesn't drain, doesn't dry, and the timer gets stuck without showing an error code, I'd first check the drain pump, pressure sensor, heating circuit, and wiring/connectors. A blocked drain...