According to your snippet, the [onload] TBS fields will be moved into the entity w:shd
and the attribute named w:fill=[x.bgcolour]
. Which is wrong.
What you need is simply to move the TBS field [x.bgcolour].
It can be done with something like this :
<w:tcPr>
<w:tcW w:w="3081" w:type="dxa"/>
<w:shd w:val="clear" w:fill="FF0000" w:color="auto"/>
</w:tcPr>
<w:p w:rsidR="0092058F" w:rsidRDefault="0057272B" w:rsidP="007D2CAD">
<w:pPr>
<w:jc w:val="right"/>
</w:pPr>
<w:r w:rsidRPr="0057272B">
<w:t>[x.bgcolour;att=w:shd#w:fill][x.m1]</w:t>
</w:r>
</w:p>