For this kind of tasks, you may have to consider what to do if the search pattern occurs again before the offset.

```
awk -v offset=60 '/two/ {x[NR+60]}; NR in x {delete x[NR]; $0 = "replaced"}'
```

Would make sure a line is replaced whenever the line 60 rows above contained `two`.