You could just use a shell function instead:
cmd () {
rsync -avz -e ssh --exclude-from=rsync.file --rsync-path="sudo rsync" $1/ ubuntu@$AMZ:/var/www/$2
}
# calling with args
cmd "$1" "$2"
# alternatively, calling through variable without args
VAR='eval cmd "$1" "$2"'
$VAR
Less hassle with escaping this way.
Update: Edited cmd() to represent the working solution.