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;
1. Create a new shape layer
2. Create a 2-point line with the pen tool
3. click on the shape path in the timeline panel
4. Window>Create Nulls From Paths>Points Follow Nulls
5. Use Tomas Bumbulevičius expression for both null's positions with the Text Layer as your Source.
-Null 1 should have an expression that positions it always on the left side
-Null 2 should have an expression that positions it always on the RIGHT side
6. Click on the shape path in the timeline panel
7. Window>Create Nulls From Paths>Trace Path
8. Shift + Parent your red shape layer to this new null
this will animate the shape on the x-axis based on the width of the Text. I haven't done this in a long time but I know it took some experimenting with the expressions. There are ways to add "padding" within the expressions that links to sliders.
I would suggest watching some tutorials and looking more into the sourceRectAtTime() expression.