if [ ! $COMMENT ]
I think you meant to check whether $COMMENT is non-empty, but that's not what this command does. An unquoted variable substitution undergoes filename generation (globbing) and word splitting. Here, you're entering several words in your comment (sun mars venus) so the [ command sees ! sun mars venus (4 arguments) which is not valid syntax. Always put double quotes around variable substitutions:
if [ ! "$COMMENT" ]
In this particular case, this tests whether $COMMENT is non-empty. This is a shortcut because there are only two shell words inside the brackets. In the general case, the way to test whether a string is non-empty is to use the -n operator, and the -z operator tests whether the string is empty.
if [ -z "$COMMENT" ]
In ksh/bash/zsh, you can use the [[ … ]] construct instead of the [ … ] command. The single brackets are an ordinary command bound by the usual shell syntax rules, whereas the double brackets are a special shell syntax with its own rules. There is no word splitting inside double brackets, so you can write
if [[ -z $COMMENT ]]
Double quotes wouldn't hurt though.
The same goes for if [ ! $1 ] which should be if [ -z "$1" ] or if [[ -z $1 ]].
There's an additional oddity that you export the COMMENT variable to the environment when the comment is passed as an argument to the function but not when you read it with the read built-in. Unless you need to pass COMMENT to an external program, drop the word export.