@PeterB, I'll give installing OSX to an external drive a go, but from what I've read, it only installs the drivers for the device you're installing to, so that might be problematic given I only have a macbook pro apart from the iMac.
@DancesWithUnix, I'm sure it's the drive (or controller, or SSD) as the built in Apple Diagnostics say there's a SATA problem.
@Biscuit, I don't have a Thunderbolt <-> Thunderbolt cable, but that's the last thing I'll be able to try if PeterB's suggestion doesn't work out.
Thanks for all the help so far guys, I really appreciate it!