Fishrrman is right on. For the tasks you do, 2019 is NOT old and should NOT be slow. An SSD taking over for the internal should make a huge difference.
You also don't share if the iMac drive is pretty close to full, which can also cause slow-downs. Be sure to buy PLENTY of space so you can have a good chunk of the new drive empty. I forget the general recommendation but I'm pretty confident it is north of 10% and possibly 20%.
If me, I'd ride the 2019 until you
HAVE to upgrade... which will probably be when there are M6 Macs available... not because the tech guts have had it by then but because Apple will decide to bail on ongoing support of macOS updates. And even then, you could perhaps trust the OCLP hack to basically prove Apple wrong... that, in fact, an old Mac can still run newer macOS versions just fine.
Else, for your stated uses, the base new Mac Mini should be plenty. If me and I actually wanted to do this, I'd buy myself a few more months with the 2019 and pick up the new Mini after it hits the refurb store... unless some third party retailer offers it new at a refurb-like 15% discount.
And if you go this way, no need limiting yourself to
only a 27" screen. There are
plenty of great monitors to pair with a Mac that give you more screen R.E. For example, when I went separates from long-term use of iMac 27", I chose the
Dell 5K2K 40" ultra-wide... which has about the same vertical height screen as that iMac but much more horizontal screen space. I could never go back to the near squarish shape of ASD/iMac 27". It costs about the same as ASD with stand option but offers all that extra work space and a robust, built-in hub with a good mix of "the future" and "the present" ports...
I use it every day and am completely happy to let this Dell present the visual interface for macOS. Since I needed full Windows too, I also picked up a Mac Mini-like PC and plugged it into one of 3 additional video inputs, basically becoming "old fashioned bootcamp." This monitor can even split screen, offering macOS on half and PC on the other half when I have any want/need to see both at the same time.