Same idea. Show me the timeline with the and I can probably help you out. It looks like you have drawn a Paragraph Bounding Box with your text tool. When you do that the Anchor Point moves to the center of the PBB. It is important to know that. the sourceRectAtTime() method does not respect the PBB but unless you really want to go nuts with the expression the easiest thing to do is just create a simple expression that looks at the text layer, reads the text layer position, reads the height of the text layer (including descenders) and then adds the text rectangle's height to the Y position of the Graphic layer. To avoid layer naming problems with expressions if you always put the text layer just below the graphic you can use index + 1 to find that layer instead of using the layer name. A simple expression to keep the graphic aligned with the bottom of the text area looks like this:
st = thisComp.layer(index + 1);
sh = st.sourceRectAtTime().height;
tp = st.position;
np = [value[0], tp[1] + sh]
st = the text layer just below the graphic layer
sh = the text layer height as defined by sourceRectAtTime()
tp = the text layer's position
The math is all done inside the XY array in the last line of the expression:
np = the original value of X for the layer, then the Y position of the text layer (st) plus the height of the text.
You can easily manually align the graphic layer in X and use the baseline shift in the Character Panel or the Anchor Point to fine-tune the Y position. Unless you want to manually adjust the baseline shift in the character panel for layers text that has descenders you'll have to just pick a value that works and let the expression position the graphic (the box of pills)
If your comp is more complex than I think then I really need to see a screenshot to figure out the expression. If you want everything to be automatic you will have to consider the anchor point of both layers, the size of the graphic layer, and make the appropriate calculations.