Dan! Thanks so much for your help. That did it. I had to modify slightly since this caused the height to change, which I wanted it to stay constant, but I was able to fix that. Thanks again for your help.
var A = thisComp.layer("NAME");
var W1 = A.sourceRectAtTime().width;
var B = thisComp.layer("Title");
var W2 = B.sourceRectAtTime().width;
var Y = 380
var P = thisComp.layer("Control").effect("Text Padding")("Slider");
W = Math.max(W1,W2);
[W,Y]+[P,0];