in reply to Replacing, cutting, deleting lines in the file

how to do something like "find this and since that delete next 4 lines and save the file"

Possible approaches:

  1. Use an appropriate input record separator $/ (in your case, it looks like "ends here }\n" might work) and split the file into records that you then treat individually (as if they were separate files).
  2. Use a so-called state machine, i.e. set/unset variables (depending on regex matches, for example) to represent the state that you're currently in while processing the file, such as state "line something starts here", or state "next block of something starts here", and then switch your processing of the lines accordingly.