Hi Rani,
I understand you requirement is to delete/remove some collaborators when you create new document. Here you did not mention your clear requirement that all the time you create new doc or in any specific situation.
If you want to remove specific collaborator permanently you can go to setup->document setup->Document security template. In this location you select for which document you want to remove collaborator and remove it from here.
Or if you want to remove some collaborator for any specific doc type also can be one in above location.
So i feel it is not require to write a custom script to achieve this. Please let me know if you have any question.
Hope this helps you.
Regards,
Gurvi.