In this circumstance, I would make use of os.pullEvent().
If you set a bit of code that renders the screen (eg a function called draw),
then check for an event, you can test if that event was a rednet message or a key-press.
If it was a message, you can add it to a table storing messages to be displayed, if it was a key, you either add a character to the user's current message, send the user's message or exit the conversation.
example code (this is an example, it won't necessarily work):
local messagestoshow = {}
local messagessent = {}
local messagesreceived = {}
local yourid = os.getComputerID()
local otherid = 5
local msgbuffer = ""
while true do
Draw()
local e, var1,var2,var3 = os.pullEvent()
if e=="rednet_message" then
local id = var1
local msg = var2
local distance = var3
if id == otherid then
messagesreceived[table.maxn(messagesreceived)+1] = msg
messagestoshow[table.maxn(messagestoshow)+1] = msg
end
elseif e=="char" then
local newchar = arg1
msgbuffer = msgbuffer..newchar
elseif e=="key" then
newkey = var1
if newkey == keys.enter then
rednet.send(otherid,msgbuffer)
msgbuffer = ""
end
end
end
If you need me to go through what any of this does, don't be afraid to ask, rednet can be tricky at times, particularly with messaging clients.