[AT&T Samsung Galaxy S 4 General] elbyron:
I have an S4 i337m with Kitkat 4.4.2 that was locked on Bell. By using suggestions from the previous responses here, and some other guides on xda developers, I was able to successfully downgrade just the modem.bin file to 4.4.2 and then remove the Sim lock by using Regionlock Away (no entering in any system menus required). For anyone else who's a little confused about how to deal with their Kitkat S4, here's a summary of the steps I followed:

Obtain the modem.bin files for android 4.2.2 and 4.4.2. There are some links here in earlier posts, but I wanted to be sure I had the ones made specifically for the Bell firmware just in case there were any differences, so I downloaded the full firmware for each version from http://www.sammobile.com/firmwares. They have firmwares for nearly every provider. It's a big download: 1.6GB, and the "free" account is very slow - it may take several hours, but you can download both versions at the same time. Then I extracted the modem.bin file from each one (extract the zip to get a .tar.md5 file, and then open that in WinRAR, 7Zip, or some other zip compression tool). I created separate folders for the 4.2.2 and 4.4.2 versions of the modem.bin file so that I wouldn't get them mixed up.

Download and install the latest Samsung USB Drivers, the one I used was found here

Download and install Odin. I used version 3.07 but newer ones probably work equally well.

Turn off your phone, then press Volume-down, Home, and Power buttons all at the same time to boot your phone into download mode. Confirm that you want to flash your firmware by pressing Volume-up.

Plug in your phone's USB cable. Don't use a USB hub (thing that sits on your desk or is maybe built into it, which provides extra easy-access USB ports). You must plug directly into your PC or laptop. If you still have trouble, try different USB ports, and make sure you have the Samsung USB Drivers from step 2 installed.

Run Odin and click the PHONE button. Browse to the modem.bin file for 4.2.2. Ensure only the "Auto Reboot" box is checked, then hit Start. If everything goes well, you'll get a success message and your phone will reboot.

At this point you should now be able to access the hidden system menus described in the OP and in more detail on other S4 unlocking threads. But I found it easier to just use RegionLock Away. Supposedly you can get it from the Google Play store but I didn't find it there, so I just downloaded the apk for it from this thread, copied the apk to my phone, and installed it (you'll have to allow Unknown Sources, in Settings -> Security). Note that this program's main purpose is to remove Region locks, which we don't have in Canada, but it seems to also take care of all the SIM unlock on i337m models (provided you have downgraded the modem to 4.2.2 first).

Test the new Sim card to ensure there is no more SIM lock. If it's still prompting you for the code, try the solution listed in the OP.

Once Sim lock is successfully removed, you should restore the 4.4.2 modem file, otherwise certain things might not function correctly including your wifi. The process is the same as before: boot into download mode, attach the USB cable and launch Odin. This time open the modem.bin file for 4.4.2, hit Start and after it's done, you should be good to go!

I hope this clarifies things a little for those who are confused about the whole process. It's really not that difficult, but you have to be careful with Odin, as doing the wrong thing could seriously mess up your phone.