I'm not sure if this would help you, but perhaps you should take a look at one of the shader contributions in one of the AUM magazines. Matt Aufderheide has contributed one of his shaders for soft shadows. It's not perfect, as in it produces some errors and unexpected results on my pc, but the basis is there. Perhaps you can try to improve that shader?
The AUM magazine download, look for Exquisite Contributions Cheers