The following is crude in the sense that it tests for one of three values, but the principles are sound - you should be able to replace the repeated 'test and move to' with a set of instructions which use your scaled variable to determine the amount of movement. I don't think that there is a Shape Script method which will support infinitely variable values.
decoration mycolouredshape
{
noshadow=true;
if(HasTag("Confidence","High"))
{
startpath();
moveto(0,0);
lineto(0,200);
lineto(200,200);
lineto(200,0);
lineto(0,0);
endpath();
setfillcolor(0,255,0);
}
else if(HasTag("Confidence","Medium"))
{
startpath();
moveto(0,0);
lineto(0,100);
lineto(100,100);
lineto(100,0);
lineto(0,0);
endpath();
setfillcolor(255,220,0);
}
else if(HasTag("Confidence","Low"))
{
startpath();
moveto(0,0);
lineto(0,50);
lineto(50,50);
lineto(50,0);
lineto(0,0);
endpath();
setfillcolor(255,0,0);
}
else
{
setfillcolor(200,200,200);
}
fillpath();
}