The answer is pretty simple. In most ways, the K5iis will give you the better build, smoother and quieter operation, and a great feel. It is worth the extra $100 easily for the
typical photographer.
However...
Two important factors favor the K-50 in very specific situations. First, if you want to use full pTTL flash functionality, the K-5 has significant deficits that will yield untimely failures; the easy fix is the use of more consistent flash options - M, ratio, or the easy to use, highly consistent auto mode (assuming you have a flash with this function).
While most modern camera users are adept at using the LCD and taking fine pictures, many Pentaxians avoid this option like the plague (preferring VF only). And, in fact, the K-5 series is very poor at live view. Live view implemented properly - as it is on the K-50 - makes it easy to change perspective up or down (although you don't have an articulated screen to simplify the process), manual focusing is a breeze with focus peaking, and live view in general allows you greater creative freedom.
The advantages of these two cameras are fairly stark, but so are the deficits. Little wonder why the K-3 is considered so highly, implementing the best of both earlier cameras. For me, the K-50 would make more sense because I find pTTL flash cumbersome and slow (even when done at its best), and I find manual focus and live view essential for a fair share of the shooting situations I encounter. However, the K-5iis is a superior camera for basic shooting needs. It is a nearly pro-level camera, and the imaging in good light is slightly better than the K-50.
---------- Post added 03-04-2015 at 10:04 PM ----------
Originally posted by Lagom Thanks for the responses everyone. How much a learning curve is dealing with moire in the K-5iis?
Not much of a factor unless you are in the habit of shooting fences in the distance, or portraits of guys wearing intricate plaids. At worst, 1 in 100 shooting sessions will require you to blur the photo. Understanding the significant other differences between the two cameras will be the key to making a good decision.