First of all, pull the oil pressure sending unit out and put a mechanical oil pressure gauge on it and see if it's really putting out 0 oil pressure. Run it for 5 seconds or so. If no reading on the gauge, shut it down.
Secondly, how long did you drive it with bad head gaskets? Was it a...