Here's a really quick and very nasty script to auto-send a message.
I haven't tested it, and it could very well send messages to the wrong people entirely.
But at least it's something to get you going.
Alas iChat's scripting is rather... odd.
'Accounts' appear to refer to buddies, rather than accounts.
[php]
tell application "iChat"
-- get properties
get front document
tell front document
get properties
set docName to name
set stripString to "Instant Message from"
if docName contains stripString then
set IMsender to (characters ((count of stripString) + 2) thru (count of docName) of docName) as string
log (IMsender)
end if
end tell
set i to 0
repeat while i < (count of accounts)
set i to i + 1
if status of account i is not unknown then
get properties of account i
if name of account i is equal to IMsender then
log ("Found a possible sender.")
set senderAccountIndex to i
end if
end if
end repeat
send "AutoReply: Sorry, I'm not available at the moment!" to account senderAccountIndex
end tell
[/php]