This is weird. Why would the first script work and the second script not work?
tell application "System Events" to tell process "iChat"
get value of text area 1 of scroll area 1 of window "chat with andrew"
end tell
tell application "System Events" to tell process "iChat"
set name1 to "andrew"
get value of text area 1 of scroll area 1 of window "chat with" & name1
end tell
tell application "System Events" to tell process "iChat"
set name1 to "andrew"
get value of text area 1 of scroll area 1 of window ("chat with" & name1)
end tell
Given that these are the ‘original’ scriplets with which you tested, I’d say it’s just a missing space… (the concatentation in the second one would produce “chat withandrew” instead of “chat with andrew”)