I’m not sure about updating the layer name but if you need something that resizes text to a size you can try this:
w = (thisComp.width / thisLayer.sourceRectAtTime().width)*90;
h = (thisComp.height / thisLayer.sourceRectAtTime().height)*90;
if(w<100){
[w,w];
}else{
[100,100];
}
Changing the width and height numbers in the first 2 lines will decide the scale of the text within a specific comp size. Hope this helps.