Try reading the help file for "On Text" events. I knew nothing about scripting when I started, but I looked at examples and read help files. Hint: On Text events trigger when the specified text is said. Also, read the help for "/write", and look at user levels too, for the authorization part. Here's a part of what you need so you can look at it.
on 1:text:*start writing*:#: {
set %LoggerOn 1
}
on 1:text:*stop writing*:#: {
unset %LoggerOn
}
on 1:text:*:*: {
if (%LoggerOn) { write log.txt $1- }
else { echo }
Hope that helps.
PS--Sorry,