How to connect a flex ribbon cable to a screw terminal block?
run flex ribbons from the PCB to all 4 screw terminal block

Why? You're only doing the modification once, so you're probably spending more time thinking about it than will take to assemble it :)
The use of a ribbon from the PCB to the screw terminals is not the best idea, since ribbon cables have too small of a wire to reliably connect to screw terminals. They'll tend to break in presence of any long-term vibration, whether in use or in storage.
Instead, you don't even need a PCB. Get a proper crimper to crimp wires onto pins that fit in a DB-25M shell, and assemble a bunch of such wires, with ferrules crimped on the other end. Then insert the pins into the connector shell, they'll click into place, and screw the other ends of the wires into the screw terminals.
I've done just that and it works fine. I don't like the cheap sheet metal stamped pins, so we used the machined &quot;mil style&quot; ones - Amplimite 109 series (catalog here). When perusing the catalog and looking for deals, note that most parts have multiple and different TE part numbers for military, industrial and NASA qualified parts - because of different internal bureaucracy and QC needed for each target market, even if the physical part is otherwise identical. Sometimes there's so much overstock available that even prime distributors have NASA or milspec parts for cheaper than industrial parts.

pin: TE Connectivity 205089-1 (milspec) in
shell: M24308-2-283Z shell or 1757820-3 shell (whichever is cheaper),
wire: Tyco/Raychem 22AWG Kynar Wire (their Spec 44 series wire),
ferrules: Panduit FSD75-6-D, although anything similar would work.

This is a high-reliability solution - we got the wire as well as the pins from overstock, so they were cheaper than usually, but still was well worth it. The pins are crimped with an adjustable 4-point crimper:

pin crimper: Radiall crimper R282281000 a.k.a. M22520/2-01,
pin locator for the crimper: Daniels M22520/2-08 pin locator,
pin removal tool: 91067-2 tool is useful and dirt cheap,
ferrule crimper: Panduit CT-1002 or Panduit CT-1003.

When you look inside the mux then, it looks like a million dollars :) I generally like my production test tools to be reliable, and connectors and connections are the primary source of trouble, so using good ones helps. You won't do too badly looking for this stuff on eBay, since the parts are niche and it's easy to tell whether they are genuine. You have to apply some engineering common sense to it to balance your time vs. cost savings.
If you want to mess with it a bit, those HP mux boards aren't too magical and can be reverse engineered to make a bespoke variant with the D-SUB connector footprint on the board.