The script is not sufficient for diagnosis; there are probably some major hints in the output log file and .pdb files.
For changing a dihedral via IC EDIT, COOR INIT, and IC BUILD, one way is to apply COOR INIT to all atoms on only one side of the dihedral, e.g. N1, C3, and all of atoms connected to those atoms. For a small molecule, you could probably use COOR INIT on all of the atoms. Also, there could be issues if the 4 atoms listed in IC EDIT are not already part of an existing IC entry from the topology file.