I don't think the RC window is actually destroyed when you close it, so you can actually just do:
NPC Code:
function onKeyPressed(scancode, asciival) {
if(asciival == "r") {
if(!RemoteControl_Window.visible) {
RemoteControl_Window.show();
}
}
}
That way, the RC Chat won't be cleared, so you will still get the messages that were recieved while the window was hidden