Like this perhaps?
Code:
  if $read(filename.html,w,*</body>*) {
    write -il $+ $readn filename.html <Your text to write>
  }