You can still place single quotes as long as the variables are intended to be initially expanded before the whole command string is executed on the shell on the remote server.
sudo ssh server "echo \"$SOMEVAR\"; awk '/pattern/{print \"hello\"}1' file > file.tmp"