I also had a catastrophe upgrading a 2007 iMac to 10.7.
The install process – from how I understood it, was very if not overly analytical, and discovered that although my iMac seemed to work fine as far as I was concerned, from a software point of view it was ‘unreliable’ and should be thrown away!
history
Shortly after I bought the C2D iMac I accidentally plugged-in an FireWire cable to a F/W HDD upside down to the back panel of the iMac, there was a brief burning smell and F/W never worked again. I didn’t care as the HDD also had USB2, so I carried on.
Come the day when I tried to install Lion, it erased 10.6.8. but never successfully installed 10.7, it got stuck in a loop, with streaming error messages about my firewire port not-working.
In fact it was worse, some low-level firmware/drivers must have been half-upgraded as the ONLY OS that iMac could subsequently use was Ubuntu. I was never able to go Apple again! I spent weeks & tried EVERYTHING, I now have a nice Linux iMac for experiments.
Another C2D iMac, this time a 2008, with 4+2GB RAM, was able to be upgraded directly to Mavericks, and with a new fast 1.5TB drive inside still works great as an iTunes media server & web-browsing PC. Mavericks with its memory compression works well in ‘ram challenged’ older macs.
You might consider trying the AHT – apple hardware test function, run in a deeply analytical mode – or just browse the console logs & look for ‘minor’ errors that could become major when upgrading to 10.7.