This actually sounds more mechanical then electrical.
(Unless you have a poor connection on the lock delay wires, in which case you have an easier job to do)
I think it might be a plastic breakdown - the lock comprises of a pair of jaws, activated by a electrically operated solenoid. When the spin cycle ends, there is a short delay before the jaws are released and you can open the door.
All this causes wear on the 'tang' that is part of your door lock, in some cases it almost wears the tang away, this leaves a loose piece of plastic which jams the lock, a bit of jiggling around will shift it, until it doesn't want to play anymore. Then it won't open - or maybe it does, but it won't close.
Anyway, it'll need to be replaced - if you are ok with that its not a big job
TURN OFF THE MAINS POWER BEFORE REMOVING ANY PARTS
(remove the top, you can then get access to the back of the lock, open it with a screwdriver and continue to refit the new parts thru the front.)
Hope this helps
George from Wolves, September 2008