not sure if this will help as im not sure how i did it but worth a try.
When I upgraded to OS4 on my 3gs I actually wiped the phone totally rather than just doing an update. I then ran the JB on it (use PDANet rather than pay o2 £30 a month to use my phone as a modem), re uploaded all my apps from itunes (not a restore of a backup, a total reload) and I noticed a GLBasic icon on my screen, running it I found it was a very old version of my app. At this point I had no dev keys or anything on my phone.
I suspect if you upload the app to your device, back it up in itunes, then search your itunes folder you will find an IPA file there.
Sorry I cant be more help but I honestly have no idea how I ended up with an IPA of a non signed app and this is the only way I can think of