Yeah this is what I have seen with other POS software
I think this is a good idea
Maybe check if there is a command reference somewhere for the CCTV and if you can possibly override that setting, then it may be able to keep “history” on screen like you are trying to implement yourself thus saving you the trouble.
There would be cleaner ways of doing that - you could save JSON data to a program setting, or you could store each item as a delimited list in the program setting which you can then easily convert to and from a JavaScript Array and more easily manipulate it.