This After Effects expression allows you to determine the bounding box of a text layer. It can be used to dynamically link some properties (for instance the position of an other layer) to the text size.
Download project file: motionboutique.com/text-bounds-expresssion-364
UPDATE: Textbox, Easily add a box behind your text layer. motionboutique.com/textbox