You would have to get the length of the string that the player has entered. using this you can work out roughly how big it will be.
To work out the max number of characters just fill up a text box and reposition it until it reaches a size limit you think would be acceptable. Then get the length of that string you put in. Also figure out the max size for your string.
Now that you have the max number of characters you will allow. You can do
local SFP = Frame.Position -- Starting position
local MaxSize = 10
local MaxLength = 50
local Factor = string.len(TextBox.Text) / MaxLength
Text.Size = MaxSize * Factor
Frame.Size = Frame.Size * Factor -- Not 100% sure this is the correct way but you get what im trying to do
Frame.Position = SFP / Factor
This is roughly how I would go about it. I wouldn’t copy and paste this tho, most likely will have a bunch of small stuff to change.