You need to get GameUserSettings first:
Here you have ton nodes of different settings but there anti aliasing quality:
And then save them:
You can also execute console commands to set other things, reducing you problem to finding right command
Note that page you linked mentions that MSAA is used only in primitives used in editor