Wow, you really are lucky, you were seconds away from a hand grenade job !
Sadly, I reckon it’ll be very difficult indeed to separate cause from effect and identify what the root cause was. So going through everything to clean, inspect, measure, is your only real option.
I also think you’ll be lucky with the crank too, most damage appears to be deposits rather than removed metal. I reckon you’ll get away with a re grind.
Not sure how deep those gouges in the case are. If not too deep I’d smooth them out to remove stress risers. If too deep for that, they should be filled in with weld before smoothing. Might sound scary but it’s not a big job at all for a competent welder.
Other than that is ‘just’ straightforward rebuild time, starting with a very careful strip and absolutely thorough clean, of everything, inc the inside of the crank, oil pump, all oil ways AND the oil tank, etc. EVERYTHING.
Its just up to you to decide whether to build back as is, or build back better.