Error in restoring iOS 5.1.1 on iPhone 4 using custom IPSW
I'm able to restore iOS 5.1.1 on my phone using sn0wbreeze. I'm posting the details here in case someone else encounters the same problem.

Initially I used redsn0w to create a custom firmware file but it failed to restore (with errors mentioned in the question and others like error 14, etc.).

Then I used sn0wbreeze to create a custom firmware stitched with my shsh blobs and iTunes restored it without errors.

Here are the steps I followed:  


Downloaded a firmware that i wanted to restore (5.1.1 in my case).
Added my shsh blobs for that firmware using iFaith mode in sn0wbreeze.
Created the custom IPSW in sn0wbreeze and stored it on my desktop.
Put the iPhone in pwned DFU mode. Use iREB or redsn0w to get into the pwned DFU mode.
Used the custom ipsw file to restore in iTunes.


I don't know if these things count, but during the process my antivirus was disabled and I had commented out any gs.apple.com lines in my hosts file.