Copying from my original post. You have to trace open ports, & see what it is stuck on.
How to Fix Step 2 and Step 3 Errors in iTunes: Music Media Formats, and Checking Firewall
This solution assumes that you do not have corruption in your iTunes library database. To fix that follow the steps in Apple Support KB ht1251 above.
Step 1, 2, or 3 Hangs: Problems with Media Formats.
If you have heterogenous media formats in your music files, some of them will FAIL iTunes match, causing it to hang. This is a software error in iTunes match, which should mark the files as "Not eligible" instead of remaining stuck in an endless loop. These errors never occur if all the songs in the music library are unprotected AAC 256 kbps music files encoded by iTunes 10.5.1.
There are two basic ways to upgrade your song media formats to iTunes 10.5.1 AAC encoding - encode all of them at once, or do them selectively. In either method, you must delete the original version from iTunes and your file system. If you previously loaded them to iCloud, get rid of them there also.
You will be able to see a hung file in OS/X under Activity Monitor -> iTunes -> Inspect Process -> Open Files and Ports. In Windows you will have to use standard Task Manager inspections.
In my iTunes library, I found that certain AAC (m4a) files which were encoded in before 2011 were stuck, and m4p Protected AAC files. I had already fixed the encoding of MP3s, so I was suprised that music previously encoded by iTunes was hanging up.
You may convert all files which were not encoded at 256 kbps AAC with a right-mouse click. Find them:
1) individually in iTunes as you discover them in Open Files and Ports trace, or
2) by creating a sort smart playlist that matches their pattern. For example, a playlist with bit-rate < 256k.
After converting them, you MUST delete the previous file(s) from your iTunes library. I suggest you move the actual file to trash, and delete the trash. Archive the files if you wish. If any of them were already matched to iTunes Match, you must delete them there also.
After getting rid of older media formats, re-run iTunes match. Step 2 should complete, and your Open Files and Ports window should no longer show any music file open in your iTunes library. If it does show, convert it and remove the old file from your library.
If you have converted your music library and Step 3 is still stuck, it is likely a Firewall problem. Check the last line in Open Files and Ports, and use the information in the last rows to check your firewall settings. The upload port is shown in this form, 192.168.1.1:53089->72.21.214.201:https. If you see this type of row, but nothing is being uploaded, a firewall or other issue is blocking that port.
In my case the block was created by my broadband modem settings. Check with the installation guide for your modem - typically they can be managed by a http:// address such as http://192.168.1.254. Change the firewall settings as needed.