Try to do the following for the text-boxes anchor points (assuming they are both separate layers).
Left one:
sourceSize = thisLayer.sourceRectAtTime(time, false);
T = sourceSize.top;
L = sourceSize.left;
W = sourceSize.width;
H = sourceSize.height;
([L+ 0,T+H/2])
Right one:
sourceSize = thisLayer.sourceRectAtTime(time, false);
T = sourceSize.top;
L = sourceSize.left;
W = sourceSize.width;
H = sourceSize.height;
([L+ W,T+H/2])
You could use your used expressions with the same wording – just pasted here what I use. Most likely you will need to adjust position as well, but this will give you an idea how to make an object sticky!
Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Social Media Profiles