The Moto G31 supports Project Treble, so there's a good chance it'll take a GSI. However, it does have a MediaTek chipset, which doesn't always play well with GSI. So it might boot, but lose the ability to make calls and texts. Alongside the small risk of bricking, I wouldn't do this if it were my main phone, but if you'd like to take a chance:
- LineageOS GSI: https://sourceforge.net/projects/andyyan-gsi/files/ Go for lineage-21-td since it's based on the TrebleDroid GSI, which tries to support as many devices as possible. You may also want to try just the plain TrebleDroid GSI if the LineageOS one doesn't work too well.
- Guide to install: https://www.makeuseof.com/how-to-install-gsi-android/
Speaking from having experienced the misery of installing a GSI on a budget Samsung tablet with no custom ROM support. Also, if you run into completely unintelligible posts on XDA forums, that's not your fault. It's the only source for some very niche information, but very few people there can write a coherent tutorial from first principles.
I would agree that's the way to go given the importance of your current phone.