I just tried again, and it endlessly hangs on "verifying IMAP account info" and says something about being invalid. Again, this works fine on my computer.
Well, it can't
endlessly hang if it subsequently gives you an error message, non?

After the error message, did you check to see if the account was actually added or not?
If I remember correctly, one annoying feature of the way IMAP is set up on the iPhone / iPod is that it insists on trying to connect to the server on default ports before it gives a chance to change the port / security configuration. So sometimes with non-standard setups, one must wait for this to fail before correcting the ports.
The other possibility that comes to mind immediately is that, if this is a small mail server that a friend set up, as you say, if you are trying to set this up via EDGE or 3G, your phone company's DNS may be failing to find an IP address for it? If this is the case, try getting the numeric IP for the server and using it instead of the domain name, possibly. And also just to ask the obvious, this isn't a personal mail server set up on some computer in someone's dorm room, is it? That is, it
does have public internet access, and it wasn't just working in Thunderbird because the computer was connected to the intranet, was it?
There isn't any "trick" in any event -- most mail should behave essentially the same in Mail on the iPod as it does in Mail on a Mac or on Thunderbird.