There is currently no action code that selects a note, as in selected in the current view in the AI. But, there will be such a method in v9.6.0, which is not far off.
Within action code (i.e no affecting the on screen selection) a path or IDString can be used to set the locus of action:
// this sets $Color in the current UI selected note, i.e. default usage
$Color = "blue";
// sets $Color in note "Some Note"
$Color("Some Note") = "blue";
// sets $Color in note at path /path/to/Some Note
$Color(/path/to/Some Note) = "blue";
/// sets $Color in note with IDString 'tbx:BkrVq9'
$Color("tbx:BkrVq9") = "blue";
In your action code you could also use stamp(“this action”). This is a method I use to apply action code to a specific note. There are of course, other methods.