Here's the answer (well, one possible answer):
Code:
variable=`awk </dev/null -v xyzzy="$x" 'END { if ( xyzzy >= .9 ) print " 254 0 0"
else if ( xyzzy >= .8 ) print " 0 254 0"
else print " 0 0 254 "}'`
There were multiple problems:
1. Single-quotes were preventing the expansion of $x in the quoted program. Oops.
2. You didn't give awk any input, so it's reading stdin. Not good.
3. If you gave it an empty input stream, then no pattern-match will occur, so no output. Not good.
To solve these:
1. I avoided adding escaped double-quotes by using an awk variable (xyzzy),
which is assigned a value by the -v option.
2. I gave it /dev/null to read from, which will give an immediate EOF.
3. I used the special pattern END, which is executed when EOF occurs on input.