How can I stop people using Gamemodes to cheat and instead give them an achievement for trying?

Solution 1:

You can use the selector @a[gamemode=creative] to detect all players in creative mode.

But if you allow players access to commands, you can't guarantee for anything. They could just use /setblock to replace the command block detecting their gamemode change or do something else against it. There are ways to prevent that, but you're very quickly getting into an endless game of cat and mouse to prevent every possible way they could tamper with your system. That can be fun (I'm planning to do such a thing in the future), but it's certainly not what you want in this case. Better just disallow commands for everyone.