Applescript causes long error messages to be logged in system.log
I just discovered that a nested tell will stop the errors, ie

tell application "System Events"
    set activeApp to short name of first process whose frontmost is true
    tell application activeApp
        repeat 5 times
            display dialog "Hello world" giving up after 2
            delay 2
        end repeat
    end tell
end tell


Still don't know why though...