$ns color color-id defines color index for nam. Once specified, color-id can be used in place of the color name in nam traces.
$ns trace-annotate annotation inserts an annotation in nam. Notice that if <annotation> contains white spaces, it must be quoted using the double quote. An example of this would be $ns at $time "$ns trace-annotate Ëvent A happenedSPMquot;" This annotation appears in the nam window and is used to control playing of nam by events.