I am a fan of keeping old Macs in service but, in this case, I concur with my wise colleagues. The 2011 iMac 27 had issues with its video hardware and you could spend a bundle on a new internal drive and still original the gfx card go walkabout three weeks later. And your current problem could be something else.
The external drive option should IMHO, only be used as a last-ditch recovery action. The 2011 iMac has only USB-2 ports that transfer data at a max of 480MB/sec. That could be glacially slower; your internal drive bus is SATA 6GB with the potential for doing 6000MB/sec. Apps could time out.
The 2011 Macs were the last to come with bootable system install/restore optical disks. Do you still have yours? They might help show if something other than the HDD is toast.