Hey Ricky, more information is needed about your layout and use case scenario.
1. Are you going to place this strictly in some area of the screen, or not?
2. What flexibility is preferred to adjust there?
Anyways, to breakdown this quickly if this is center aligned:
1. Instead of path, use thin rectangle.
2. Use sourceRectAtTime to get ‘text layer’ size.
3. Apply paddings by attaching sliders to rect shape’s x and y.
4. Animate horizontally by using interpolation: ease(time, inTime, outTme, rectLeftEdge, rectsRightEdge)
5. Apply expression to text and rect shape:
sourceSize = thisLayer.sourceRectAtTime(time, false);
T = sourceSize.top;
L = sourceSize.left;
W = sourceSize.width;
H = sourceSize.height;
([L+ W/2,T+H/2])
Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer – Dynamic Text Boxes Template with a Live Preview