@murthy: After reading all your posts one more time following is my opinion. Let other experienced experts give their opinions as well.
1. File custody/visitation petition immediately.
2. File for restitution of conjugal rights under S.9 HMA requesting your wife to join her marital home. I thought of this because you mentioned your wife and your child are living in very bad environment and it will not be good for your son's future. If she joins you, you will be able to work hard to convince your wife and son about the pleasures of a family life. Also the recoincilation/mediation efforts of the court as part of the proceedings may succeed in convincing your wife to join you. At some point you can hire good marriage counsellor to help your wife understand the virtues of family life. Also your son will be mature enough to understand your efforts as a father and will be with your beyond his 18 years.
3. If your wife does not join you inspite of the above RCR, and if the RCR decree is given in your favor (most likely it will be in favor because you are trying very hard to restore your home), you or your wife can file for divorce after one year upon non-consummation of the court decree.
The whole process once set in motion will teach you your rights towards your son as a father and if you fight hard you will gain custody rights or in the best case restore your marital life.
I really sympathise with your situation and whole heartedly wish you good luck in your fight for justice.