Hi Mark,
Just wanted to chime in here.
The rp2040 is a great choice for this application. However there's a few things I would personally do different.
The main thing; is not reinventing the wheel.
There's already an extremely robust, easy to use firmware compatible with RP2040 that can most likely do exactly what you need (QMK)
From a single key press, to typing whole strings, it's very robust, and would make future changes simple eg with vial support.
Secondly, with regards to the MRI,
I would tackle this using optics only, you can use off the shelf fiber patch cables; going to couplers at either end,
You don't need fancy transceivers, only a bright LED at one end of one fiber, and a light sensor on the paired return fibre.
Then at the foot switch box, you need only to have the fibers point at each other, and pressing the foot switch breaks the beam!
This way there's no electronics involved near the MRI.
But definately check out QMK. You can probably even just use an existing two key layout and just adjust the keymaps for your purpose.
Even in your existing hardware you may notice a significant improvement given how much work has gone into it!
Lewys