I got something exactly what your looking for. I could easily sell you my license to the script, as It's not mine.
there are free wordpress plugins that do that, track every clicked links, how about google first, before someone try to sell you what's already free?
I would agree with what cvrle77 said. Modify an existing url shortening script to save user's IP using $_SERVER['REMOTE_ADDR']
I am amazed no one has suggest yourls yet, it has all the features you require and it is opensource.