Jimmijazz,
What happens to the shares that are written off or abandoned is a murky area because of the unusual nature of value recovery after the abandonment or write off. This is a question for a CPA that specializes on tax law and knowledge about precedential cases. Nonetheless, common sense sheds some light on this, as follows:
When abandoned, the owner is supposed to have given up all ownership rights to the security, which is not the case when you take a loss for worthless securities. In both cases, you have already taken a tax loss for your basis in the security and enjoyed the tax shield either fully (if you had capital gains you offset with the capital losses), or partially (if you had excess capital losses you have been amortizing at $3,000 per year).
However, since you own the securities for all legal purposes (i.e., they are listed under your name at the DTC) and any recovery would have to be paid to the legal owner, I very much doubt that the IRS will reject a tax return that includes a tax payment from the realization of capital gains on securities previously abandoned or written off. Of course, the IRS would not want you to have a windfall by allowing you to keep the previously taken tax benefit, so these would need to be accounted for.