For $ 500 more you could get a mower that will last 1/2 as long as the one you are replacing .
Go to the surplus engine wholesalers
Small engine warehouse
SMALL ENGINE SUPPLIERS
SURPLUS CENTER
Any engine with the same shaft diameter & length can be made to fit
Any B & S engine will be the easiest to fit because the controls will transfer from one to the other sa the mounts are the same .
Electrics same story off the old & onto the new.
Other brands can require new control cables and rewiring .
Bad time of the year to be looking for a new engine.
As for the 31R engine, check the shaft size length & type before you buy it.
The block will be the same as your motor so everything inside your old engine will fit as a worse case.
Different alternators , blower housings etc will give an engine a different number but the blocks are the sme so your old lternator will bolt onto it, your old muffler will fit etc etc etc.