patch 8.2.0585: Vim9: # comment not recognized after :vim9script

Problem:    Vim9: # comment not recognized after :vim9script.
Solution:   Check script type. Make comment after ":echo" work.  And in
            several other places.
diff --git a/src/eval.c b/src/eval.c
index fbbae63..af22896 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -6061,7 +6061,7 @@
 
     if (eap->skip)
 	++emsg_skip;
-    while (*arg != NUL && *arg != '|' && *arg != '\n' && !got_int)
+    while ((!ends_excmd2(eap->cmd, arg) || *arg == '"') && !got_int)
     {
 	// If eval1() causes an error message the text from the command may
 	// still need to be cleared. E.g., "echo 22,44".