How to build a command into a string rather than execute the command

I'm trying to populate a command line into a variable. It appears to be executing, instead. Here's an example:

mycmd=''
if ...; then
$mycmd='sudo '
fi
$mycmd=$mycmd 'sed -i prev s/aaa/bbb/' $myfile
res=`$mycmd`

(I'm also not sure of the best way to execute the command from the variable, either, so any corrections would be appreciated!)

mycmd=$mycmd 'sed -i prev s/aaa/bbb/'

(no $ at the beginning of the line)

fab@adeon:~$ a="echo hi"
fab@adeon:~$ $a
hi
fab@adeon:~$ eval $a
hi