Ind3: replace with 1 or 2 breaks depending on which frame

if the first of two chained text frames contains a special word (“highlights”) this has to be replaced with two column breaks, else if the second contains the word, it has to be replaced with one column breaks.
whats the code?

thanks

(and where can i find some real simple example-scripts which show me how to handle insertion points, add text etc?)