I think the best way to do this is to use a List Box to display chat logs. If you do so then you would automatically have that function. The thing is the list box does not work on mobile last time I checked.
If you are using a text box you could make the text box scale so that the text is always present then add the drag and drop feature, use and event to prevent X movement. In this case you may want to utilize layers to simulate a window by overlapping the text layer with a solid background with a translucent square; note you can also use the destination out blend mode if the chat box is laying on top of a functional area.