Mail applescript stopped working on Yosemite
Thanks to  Buscar comment I solved it:

tell application "Mail"
set accountlist to the name of every account
try
    repeat with n from 1 to (the number of items in accountlist)
        set _msgs_to_move to (a reference to (every message of mailbox "INBOX" of the account (item n of accountlist) whose flagged status is false and was replied to is true))
        set _msg_list to contents of _msgs_to_move
        if (_msg_list's length &gt; 0) then
            move _msgs_to_move to mailbox "messaggi letti"
        end if
    end repeat
end try
end tell