You can't.
The best you can do is have the script run repeatedly, say every 10 seconds, checking the current URL and updating iChat if it's changed.
There is no way to automatically run the script as the window changes in Safari - that would require a change in Safari to call the script since it's the only thing that knows it's changed.
It's relatively easy to rewrite your script to check periodically. Either wrap it in a 'repeat/end repeat' block (with a 'delay 10' (or however many seconds you want) for the interval between checks).
A slightly better solution involves using an idle handler. This puts less load on the system than a 'delay', but needs a little more work.
First you'll need to put your code into a handler (which is easy enough), then you call that handler via the
on idle handler. Save the script as a 'stay open application' and you're done.
on checkURL()
tell application "Safari" to set my_URL to URL of document 1 -- no need/desire to 'activate'
tell application "iChat" to set status message to myURL
end checkURL
on idle
my checkURL()
return 10 -- or however many seconds before the next pass
end idle