There are a some different calls you can make that I am aware of depending on who you want to send the notifications to. Some objects like the sector have a "broadcastChatMessage" method to send a message notification to everyone in the sector. If you want to see some examples, look in the file data/scripts/events/traderattackedbypirates.lua to see the various messages broadcasted out by the random event of pirates attacking a transport.
Then there are objects like the player object with a "sendChatMessage" method to send a more targeted message. Strangely, the event for random xsotan attacks uses player directed messages in data/scripts/player/events/alienattack.lua, which is why in multiplayer only one player gets notice before the xsotan pop into the system.
One of the parameters of these methods then controls the type of message, whether it's an error message, informational, or treated like a text message from someone.