downgrade from iOS 5.1 I've clicked "Erase all settings" on my iPhone 3GS and it went into a locked state where I couldn't get to the login screen in any way. I then decided to upgrade to 5.1 but forgot to save the SHSH.

Is there any way to downgrade to 4.2.1 or at least something different than 5.1?

Thanks!
You may actually have some SHSH blobs saved for your device, since Cydia automatically tries to save any available SHSH blobs every time you open Cydia. Also, I believe Apple is still signing iOS 4.1 for iPhone 3GS (I don't know why though).

You can use TinyUmbrella (a free tool compatible with OS X and Windows) to check your saved SHSH - plug your device into your computer, click the "Advanced" tab in TinyUmbrella, check "Request SHSH from Cydia", and then click "Save SHSH".

If you find that you have suitable SHSH saved for your device, you can use this guide to stitch the SHSH blobs into custom firmware (using redsn0w) and then restore with that firmware.