If a value is set using the Sys.Preview.UI.TextBox.set_text, the TextBoxWatermarkBehavior will override the value if the control gains focus.
This happens because the value of the field this._watermarked inside the TextBoxWatermarkBehavior is not changed to true.
The TextBoxWatermarkBehavior only works well for user input.
The workaround for this checking first if the html element has the Behaviour, and if so, set the value using the behaviour:
if (txtCO.get_element().TextBoxWatermarkBehavior){ txtCO.get_element().TextBoxWatermarkBehavior.set_Text("hello world!");}else{ txtCO.set_text("hello world!");}
If the TextBoxWatermarkBehavior where to be changed, the initialize method of the beaviour could check for the existence of the control property in the html element, and if so, attach the text property change event to his keypress event, solving the problem. A issue with this was open at codeplex. Go there and vote.