Applescript - activate background application doesn't work Why doesn't this work

tell application "System Events"
    set AppName to name of every process whose background only is false
    tell application (some item of AppName)
        activate
    end tell
end tell


while this

works

global AppName
tell application "System Events"
    set AppName to name of every process whose background only is false
end tell

tell application (some item of AppName)
    activate
end tell


Obviously, it has something to do with scope but I don't understand why or what.
I think the problem is..  Telling an application to activate, is handled by "Standard Additions", but you are asking "System Events" to handle that action. 

tell application "System Events" to set AppName to name of ¬
    every process whose background only is false
tell application (some item of AppName) to activate