This thread is another example of how to over complicate things. This should do it:
sed '0~30 s/$/string/g' < inputfile > outputfile
Every 30 lines “string” is inserted at the end of the line. If you want a new line with the word “string” just use “\n string”.