That means I should write a Task which updates the messages or can I also write a second function that updates the form messages?
If you only need to display chat messages there, you could listen for that event(PlayerChatEvent, I think?) and update the form then. That way you aren't using extra resources for a task. Also, that event would be a good place to filter out based on party members and whatnot.
You mean the chat messages? If so, you could use arrays to save your party chat messages. On the chat event you could also check if the chat messages in the arrays are more than 5 so you can unset some of them to prevent UI spam. Make sure to strval() the array data.
But I also want to add an input to send text messages via form. Do you have another solution for this?