Backup mailbox of mail.app with applescript
GUI scripting is not that great. And can easily fail due to timing or GUI changes.

But try this:

set mboxSavePath to "/Users/simonepiersigilli/Desktop/e-mail/"

tell application "Mail" to activate
tell application "System Events"
    tell application process "Mail"


        click menu item 20 of menu 6 of menu bar 1
        delay 2
        keystroke "G" using {command down, shift down}
        delay 2
        keystroke mboxSavePath
        click button 1 of sheet 1 of sheet 1 of window 1

        click button 1 of sheet of front window


    end tell
end tell