What other engine could fit inside the Viggen?
Well, start with the RM8B specs and go from there when looking at alternatives:
Length: 6.23 m (20.44 ft)
Diameter: 1.03 m (40.55 in)
Dry weight: 2,350kg (5,180lb)
Given these dimensions, just about any other engine will fit inside easily. The RM8 is a big engine physically!
Don't forget that you probably want something with at least roughly comparable (or better) performance:
Maximum thrust: 72,2kN (16,200 lbf) dry, 125kN (28,100 lbf) wet
Remember that the RM8 is basically just a licensed-built version of the Pratt & Whitney JT8D with a Swedish-designed afterburner. BTW, apparently the TF30 ( from F-111, F-14 and A-7 fame) was originally wanted by the Swedes but wasn't available.