Personally I’d just use the TextArea for display, and store/manipulate the backing data outside of the control. Once you’ve made your changes, a call to setText should be all you need to update the TextArea. This gives the benefit of not having your code rely on the TextArea if you change your mind later. While practical in a sense, relying on the replaceRange method tightly couples your game logic and your presentation method. A second benefit is that you can manipulate your data in a way that seems natural to you, and only worry about converting it to what your presentation space requires once.
Honestly though, there are many ways to skin a cat and in this particular case, just about any approach that makes sense is as good as the next one. Glad I could be of assistance.