applescript: commands to maximize (green button) an iTerm window
The perform action command is going to go the the frontmost window that meets the criteria of the the given command. As such, you need to use the activate command after tell application "iTerm" so win1 will be frontmost when the perform action command is triggered.

tell application "iTerm"
        activate
        set win1 to (create window with default profile)
    repeat until exists win1
        delay 0.01
    end repeat
    tell application "System Events"
        perform action "AXZoomWindow" of (first button whose subrole is "AXFullScreenButton") of (first window whose subrole is "AXStandardWindow") of (first process whose frontmost is true)
    end tell
...