Well, if you understand the internet, when you go to one of those websites, put in a IP, and hit sumbit, it sends a HTTP request to the server for the page that will show the persons location with the IP you gave as a parameters. The server sends back the page with the correct info using that IP and viola, you see where the person is located.
In torquescript, you would construct an HTTP object with and send a request to their server for the same page with the IP as a parameter, the EXACT SAME as your browser when you hit submit, and then pick out the coordinates from the HTML page they send back to you.
You go about building bricks and what not from there in your code