If you want a constant gap between two words then a right aligned and right anchored textbox to the left of a left aligned left anchored textbox would be the easiest solution. If you want the gap to vary then you could update the x coordinates based on the number of characters in the word. Alternatively you could use normal centred text and adjust the x coordinates accordingly – though you would need to use a monospaced font to be accurate.
I have had issues with changing textbox borders on a frame by frame basis.
The alternative would be to use a separate coloured polygon.
If you have a setting set to update every frame then it will show one frame left from the previous trial unless you actually set the colour (e.g. using textbox.setBorderColor() ) in Begin Routine. However, this may have other issues – hence polygons