not having the details or a SXCNC box to measure
I have two thoughts
there will be the space to fit the G540 in the space left when the stepper driver boards are removed
the 9 pin D-types supplied with the G540 can be fitted to the original wires that was connected GX16-4 connectors that made the connection to the stepper motor cables
a short printer cable with an adapter plate can be fitted to the rear of the box to connect your PC printer port or motion controller to the G540
this has the advantage of minimising the modifications to the box
I can not see from your photo if you have computer control of the VFD
If you don't want to fit the G540 inside of the control box
with the GX16-4 connectors used for the stepper motor connections removed
do you have the space to make a 2.27" x 5.425" cutout for the 2.375" x 6.375" G540 to be fitted next to the fan ?
John