If you are happy with the performance of you iMac, and it does everything you need it to, I would continue using it.
Just because Apple will be dropping support doesn't mean you make will be instantly unusable.
The security updates are often Safari related, and if you have security concerns, you can switch to FireFox, which will continue supporting your old iMac with security updates for a few more years at least.
I personally really like the Mid 2011 iMac. There are things you can do to that iMac that you cannot do to most other Macs.
You can replace the ODD with a SSD or HDD.
It is possible to have three internal drive on that iMac.
You can replace the GPU with a more modern one.
You can have an internal RAID0 boot drive.
You can boot from the SD card slot.
It has Thunderbolt and FW800.
It has a beautiful display on it.
You can use it with Target Disk Mode over Thunderbolt or FW.
You can use it with Target Display Mode.
It doesn't require tape strips to open it.
It is just an amazing Mac to have.
If it is a 27", then yes, it is called Target Display Mode, and will most likely require an Apple bidirectional adapter for TB3/TB2, and a Thunderbolt 1/2 cable.
Yes, it is called Target Disk Mode, and will also most likely require an Apple bidirectional adapter for TB3/TB2, and a Thunderbolt 1/2 cable. There could be some other ways of getting this too work as well, but the easiest and cheapest is probably the cables mentioned above.
Like
@r6mile has mentioned, I don't think you can do both at the same time.
You could also pull the drive from your Mid 2011 iMac.