That code looks like VBS( or some other VB flavor ). If VBS works the same way javascript does, changing the text size will not change the text box width.
There are two types of text layers, point text and paragraph text. The width property only applies to paragraph text but is the width of the text bounding box, not the width of the text itself.
You should be able to get the width of the text from the text layer's bounds property.