Google Apps Script shifting columns containing specified substring - using array functions
Just as a general note, you could avoid the temporary array by copying the array from the end. I would also use a temporary variable for simplicity:

for (r = 0; r &lt; vals.length; r++) {   
  var row = vals[r], first=row[0];
  if(first.indexOf("PO") != -1)||first.indexOf("P0") != -1)) {
    for (var c = row.length; c &gt; 0' c--) {                                   
      row[c] = row[c-1];
    }
    row[0] = "";
  }
}


However in this case you can let JavaScript do all the work:

  if(first.indexOf("PO") != -1)||first.indexOf("P0") != -1)) {
    row.splice(0, 0, "");
  }


Also, assuming you only need to support recent browsers, I would look at using methods like forEach and includes.