Your questions can be pretty much answered in the
Yahoo FAQ. But, for a quick answer - An IP address can only be obtained if you make a
direct connection with someone, ie: a file transfer, voice/web cam conversation. It's basically impossible to obtain your IP through plain text instant messages.
Its likely this guy is just trying to scare you into thinking he has some sort of control over you. Your best bet is to use the "ignore" button on losers like these. Even if he does have your IP address, its not that big of a deal. He likely doesn't know what else to do with it, but tell you he has it. Your IP address is broadcast to every webpage you connect to. Its like a phone number, you can't connect without one. Your IP is just caller-id, the only thing he can find out from it is who your Internet Service Provider is. Big Deal. Have a look through some
past threads on this Forum for more info on IP's, its been addressed on countless occasions.