Thanks for responding! Turns out there needs to be a space between @a and the coordinates to look like this for it to recognize as a command:
/gamemode 2 @a [x=1,y=50,z=1,m=0,r=4]
/gamemode 0 @a [x=1,y=50,z=1,m=2,rm=5]
At least it's reading and executing the command at all, but it still doesn't recognize the parameters, which is causing it to flicker between the two gamemodes. Settings were put to repeat, unconditional, always active.
Is there any particular reason why m has to equal 0 for the first one? I've dug around a bit, and can't find any explanation of what m even represents...
edit: It seems that sometimes after I've edited or looked at the command for a block it will sometimes become unrecognized as a command.