With brain-wave analysis and other tech, experts can probably render an accurate and objective diagnosis of sleepwalking (although that wouldn't prove that the man was sleepwalking at the time of this incident).
If he did this in his sleep, he should not be considered criminally responsible. OTOH, perhaps he should be institutionalized for treatment; until he's no longer a threat to anyone else.