Hi,
When it comes to buying a new Mac it is always to buy the fastest so you can use it for at least 10 years. Well of course that is not always true. You have several options, one could be trying Open Core Legacy Patcher to use new Mac OS versions, which is pretty solid. So you can continue using your current iMac. The second option could be buying a 2022 iMac with 27 inch screen, as max as your budget can. And you will use this machine for at least 6-7 years without problems. 3rd option could be, personally, I don’t recommend Mac Mini, the lowest version of Mac Studio would be better than that one. And you are going to need a screen. And maybe you can try a new iMac again as max as your budget can, with a second display.