Yes advocate Shroff has pretty well summarised what you can do as preventive legal paperwork. These steps should put off 99% of the neighbors from doing a criminal act. And if he does, this we go against him. But this should not make one complacent or careless about precautions and self defense. Some common sense precautions to avoid trouble can go a long way. Like remaining alert, avoiding roaming in lonely place alone outside, ensuring strong doors and windows preferably re-enforced by iron grills etc.
Also remember that Sahela Masood case, she is reported to have also written to DGP etc. of her State, but all this did not "prevent" the attacker from committing crime. It needs to be noted that the laws come into motion after the fact and not during the fact. That is why we have Sections 96 to 106 IPC wherein if a person is faced with self defense situation, you allowed to take law in your own hands to enforce it for self defense.
There have been many Supreme Court judgments in support of self defense. Following principles emerge on their scrutiny:
(i) Self-preservation is the basic human instinct and is duly recognized by the criminal jurisprudence of all civilized countries. All free, democratic and civilized countries recognize the right of private defence within certain reasonable limits.
(ii) The right of private defence is available only to one who is suddenly confronted with the necessity of averting an impending danger and not of self-creation.
(iii) A mere reasonable apprehension is enough to put the right of self defence into operation. In other words, it is not necessary that there should be an actual commission of the offence in order to give rise to the right of private defence. It is enough if the accused apprehended that such an offence is contemplated and it is likely to be committed if the right of private defence is not exercised.
(iv) The right of private defence commences as soon as a reasonable apprehension arises and it is co- terminus with the duration of such apprehension.
(v) It is unrealistic to expect a person under assault to modulate his defence step by step with any arithmetical exactitude.
(vi) In private defence the force used by the accused ought not to be wholly disproportionate or much greater than necessary for protection of the person or property.
(vii) It is well settled that even if the accused does not plead self-defence, it is open to consider such a plea if the same arises from the material on record.
(viii) The accused need not prove the existence of the right of private defence beyond reasonable doubt.
(ix) The Indian Penal Code confers the right of private defence only when that unlawful or wrongful act is an offence.
(x) A person who is in imminent and reasonable danger of losing his life or limb may in exercise of self defence inflict any harm even extending to death on his assailant either when the assault is attempted or directly threatened.
The complete judgement of Darshan Singh vs State Of Punjab & Anr. on 15 January, 2010 can be read at https://indiankanoon.org/doc/1748156/
I am also attaching a document by Massad Ayub a police officer about preventive steps related to tackle bulgary, house breaking etc. I found it to be interesting reading.