I've read that you need to save the edited Commands.ini file to either a folder in My Documents or to your Desktop. It should save there okay. Then, you copy/move the edited Commands.ini file back to The Sims Medieval\GameData\Shared\NonPackaged\Ini\ (in other words, don't try to save the file directly back to The Sims Medieval\GameData\Shared\NonPackaged\Ini\)
Hope this helps and good luck.