Target display mode is different from using the iMac just as a spare monitor. Go over what Target Display mode does and see if your iMac qualifies. If you can operate that way, then that may work for you. Let us know.
It's not uncommon with a failing HD for it to crash after a complete reinstall of the OS. It just seems to push it over the brink. Logical when you think about it. If it's the original drive then it is 8 years old which is well past the average of 5-6 years years for a HDD.
Personally I'd go with the replacement SSD, my wife did this on her 2011 MBP some years back and the improvement was very noticeable. I think using an external drive will negate the speed advantages of an SSD but it would get you up and running.