A few things that will fix your issue:
1) You're using setTimeout incorrectly. Arguments for the function go AFTER the delay. The function reference should just be the function name.
if (gridContext === null) {
setTimeout(LogOptimisationAudit.SelectRows, 3000, eContext);
return;
}
2) If all you're trying to do is wait until the grid is loaded to try and get the gridContext again, I would try using an arrow function within your setTimeout. I've also removed the return statement from your condition. If your condition ran it would stop the this.SelectRows function and never get to setting your myRows variable.
var formContext = eContext.getFormContext();
var gridContext = formContext.getControl("logs");
if (gridContext === null) {
setTimeout(() => {
gridContext = formContext.getControl("logs");
}, 3000);
}
3) Depending on where this grid is in your form and what you're trying to do with your grid data, you can call this function on form load or on tab state change to get the grid rows immediately. Otherwise, using onRecordSelect would also work well since you know the grid is already loaded.
4) Lastly, consider using let instead of var for more standard code practices. No biggy tho!
Hope this helps!