Simply put, the node needs a "notes" (or s/n "nts") attribute first, then its plain sailing (manually writing a note creates the attr, which then stores the string - or so im assuming, looks like that's handled through a scriptJob)
So to add a note to a node, first check whether it already has an attribute called "notes", create one if not, then write something.
string $node=`polyCube` ; if(!`attributeQuery -node $node -ex "notes"`) addAttr -ln "notes" -sn "nts" -dt "string" $node ; setAttr -type "string" ($node+".notes") "This node now has a Note. You can store various bits of information here." ;(The note on this script example is on the transform node of the polyCube object ($node) as $node would be the shape object)