Unless you have KSS version 5.5 or higher, the messaging system for the KCP is a bit primitive, but it works.
The simplest messages are done using $LOOP_MSG[]. This is a "string" variable (in KRL, really an array of type CHAR). It's normally blank, but it you set it to any valid string (limit of 60 or 80 characters, if I recall correctly), it should show that string in the message window and produce a "SIMULATE" button in the bottom row of KCP softkeys. I've had mixed luck getting the button, but the rest of it works. If the button appears, you can monitor the $LOOP_CONT boolean variable: you need to set it True before setting $LOOP_MSG[], and monitor it -- when it goes False, that means someone hit the button. So:
$LOOP_CONT = TRUE
$LOOP_MSG[] = "This Is My Test Message"
WAIT FOR NOT $LOOP_CONT
The other, more complicated way of doing KCP messages is using the $MSG_T variable. $MSG_T is a STRUC variable with several members of different types. In general, you set your message type using $MSG_T.TYP, put your message string into $MSG_T.KEY[], send the message to the KCP window using $MSG_T.VALID, and release a message (if it's a Dialog or State type) using $MSG_T.RELEASE.