You can do ths with app.executeCommand(number returned by find); and app.findMenuCommandId(string);
The way most of these work are the same if you was to do it manually. E.g. To update markers you need to have the layer selected, then Layer > Markers > Update... So you need to do the same in script.
Also if a layer that isn't a comp and is selected that menu would be greyed out same will happen with scripting.
app.beginUndoGroup("Update Markers From Source");
layers = app.project.activeItem.layers;
app.executeCommand(app.findMenuCommandId("Deselect All")); //Make sure non comp items are selected
for(var i = 1; i <= layers.length; i++){
if (layers[i].source instanceof CompItem){ //Make sure layer is a comp
layers[i].selected = true;
app.executeCommand(app.findMenuCommandId("Update Markers From Source"));
layers[i].selected = false;
}
}
app.endUndoGroup();