This is just a way of stopping people using up their annual CGT examption by selling and rebuying shares, thereby uplifting the base cost free of tax. Therefore if the shares are rebought within 30 days, the new shares are deemed to be the ones sold; in your example, if the shares were sold and rebought both for �1500, there would be no capital gain arising.
If they were subsequently sold for �2000, and not rebought within 30 days, the shares would have the original base cost of �1000, a gain of �1000. Sale proceeds of �500 would produce a loss of �500.
It just means the bead and breakfasted shares are effectively ignored (although there will usually be a small gain or loss with price fluctuations and selling costs). The calculations can get extremely complicated if shares have been held for many years, this is obviously a simplified version.



