It could be useful to set ex-ante what is your investable universe.
It is pretty typical that at any period of time you would track only names wich are part of a Benchmark (SP500, R1000, FTSE, Nikkei 225 etc). Or set your own rule for what would consider an investable company. Usually the main criteria are : Market Cap, Market Cap accessible to global investors and median or average liquidity in the last 6 (or 1,3,12) months.
As you observed it is critical that you have no survivorship bias. That's why Benchmarks constructed by reputable vendors is usually a safe way to go.
Now, apply your investment policy/rule to analyze the performance of stocks with high/low corporate social responsibility rating that are in your investable universe. In the forward returns (holding a stock) make sure you take into account any bankruptcy and stocks moving out of your investable universe.
For example: You buy company "FOO" at the end of December 2015 and you have a yearly rebalance process. The company might go bankrupt in August 2016. So when you are holding this name for a year you will likly have a -99.99% return for that name when you rebalance at the end of December 2016. At the same time the likely outcome is that that name is not in your investable universe anymore and would not impact again your performance. This is very similar to how most portfolio managers would operate in general.
You can adjust this methodology for a different frequency. The essential is to have a sense of what is an investable stock at point t, independently of what will happen in the future (no survivorship bias and no look ahead bias).