I've used both of these lenses and it is really hard to say which is better.
I will try to explain why.
Image quality:
Even though, sharpness is very good on both lenses, bokeh is better on Sigma.
Color rendition. Well, both lenses render colors really nice, but I prefer the colder look that Sigma produces that the warmer from 31.
CA - Sigma is miles away, 31 suffers from CA pretty badly.
I give a point to Sigma here.
Build quality:
31 is all metal, looks like a jewel. Even though usually suffers from wobbly front element which isn't acceptable for such an expensive lens. Also, there is a little movement in the focus ring when camera is in AF mode (no QS for the 31). Yes, these are small things, but for 1.3K $ lens, they are hardly acceptable (IMO).
Sigma is mostly plastic, but has a metal mount. No wobble or anything, feels very solid. Features internal focusing, quick-shift which makes the lens feel high quality and very well build.
Hard to say which is better. I'd say it is a draw.
Auto focus:
31 is screwdrive, Sigma - HSM. Both focuses very fast and both lenses didn't need any AF adjustments (on K5IIs).
Win for Sigma (for silent focus)
Joy of use:
Sigma is a very large lens compared to Pentax. Heavy too. Grip is necessary for comfortable use (IMO). So, it is a little tiring to use it for two or more hours. The biggest drawback for the Sigma is that you may not have it when you need it.
Pentax 31 is small and light. It will fit in any camera bag, there is really no problem having it always with you.
Win for Pentax. Quite subjective, but I enjoyed using the 31Ltd a bit more.
Conclusion:
So, even though the overall score is Sigma 3, Pentax - 2, I'd say there is no real winner here. Both lenses are very good and you should get the one that suits your priorities better
Hope it helps
P.S. information written above is 100% subjective, based on my semi-pro use and it is absolutely normal if it varies from yours