It is a bit weird. The documentation doesn’t make this super-clear, but markers are basically a special kind of keyframe, and keyframe values are set with .setValueAtTime(). Not only that, but markers use a MarkerValue object as their data type, so if you want to change the comment text, you have to do so by creating a MarkerValue object to contain the comment.
Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive | RenderBreak [blog] | Profile [LinkedIn]