If you cut off cylinder 1 and 4, the GSXR 750 of 90-something year will fit on a GS 500. If you have won the lottery you can put a Intruder M1800R engine in a Bandit 400
For the rest, a GS 500 feels like a moped and a Bandit 400 feels like a motorcycle. Feels does not mean rides, but the Bandit is faster. A restricted B4 is faster than a restricted GS 500, even though you'd think a GS 500 has more torque. A GS 500 is cheaper to buy and maintain than the B4.
If I had a choice, I'd go for the B4 any time, no doubts at all.