Not sure I understood what you want exactly but the code below merges cells B1 & C1 if value in A1 meets one of the 3 conditions you choose.

```
function onEdit(e){
var range = e.range;
Logger.log(range.getA1Notation());
if(range.getA1Notation()!='A1'){return};
if(range.getValue()=='a' || range.getValue()=='b' || range.getValue()=='c'){
SpreadsheetApp.getActiveSheet().getRange('B1:C1').merge();
}
}
```

It runs automatically when a cell is edited and does nothing if the cell is not A1.

EDIT : since it appears from your comments that you wanted it to work for all the rows, here is a version that will merge cells in col B and C in any row if column A in this row meets the condition.

```
function onEdit(e){
Logger.log(JSON.stringify(e));
var range = e.range;
if(range.getColumnIndex()!=1){return};
if(range.getValue()=='a' || range.getValue()=='b' || range.getValue()=='c'){
SpreadsheetApp.getActiveSheet().getRange(range.getRowIndex(),2,1,2).merge();
}
}
```