Shadow Pokemon don't have abilities (I think). When they are purified they gain their traits (ability, moves, nature, even their gender changes ). However they will always have fixed EVs/IVs. I believe you can just save before purifying a shadow Pokemon and then keep soft resetting until you get the ability/nature you want.