You could try systemd-inhibit as a prefix to any game launch command, much in the same way as gamemoderun is used.
Sidebar: this could be considered an example of the XY Problem. You should consider editing the title since the problem you’re really hoping to solve is your laptop going to sleep while you play a game.