I loved my k-x, but the choices you listed would not be my next step (I've owned a k-5, k-3, k-1, and k-s1).
Don't miss the AA batteries, they are actually a right bother. Assuming you remember to charge the battery beforehand, the camera with the worst battery life is the k-x/k-r. You'll get twice the performance from the k-s1 battery, and it won't degrade over time in the same way.
I can't comment on the k-30/k-50 too much (i once played with a k-30 at the British Grand Prix, whilst swapping out my DA40 ltd on my k-x, to take a shot).
The k-s1 has a really bad reputation, and I don't think it's deserved imho. When I bought my k-x, everyone was banging on about how great it was (high ISO performance, great IQ, cheap, and decent build quality). Yes it didn't have weather sealing, yes it used AA batteries, yes it didn't have the AF points highlighted in the view finder, but it was alright.
The k-s1 follows that trend. If you want cheap, with fantastic IQ, a superb viewfinder, then it's a no brainer. Compared to the k-3, it's not weather sealed, the white balance is a little suspect in poor light, and it doesn't have a second wheel. If you gave me a choice between the k-5 and the k-s1, id choose the latter. If I could afford a k-s2/k-70/k-3, id but those options. However, for best IQ for low cost, I'd skip the k-30/k-50/k-r models, and go straight for the k-s1.
The images from the k-3 are better than those from the k-s1, but not by much given decent light. If you've managed to survive on a non weather sealed camera for so long, then the IQ from the k-S1 craps all over the k-50/k-5/k-30. The high ISO performance is a notch above the k-3, and previous k-5 era sensors in my opinion.
The only downsides to the k-s1 in my mind: ergonomics could be better. White balance could be better. 12bit vs 14bit raw. No weather sealing. I'd prefer a k-3 in all honesty, however over the options you listed, the k-s1 would be my second choice. (It's just the k-x, but with a sensor that can, sometimes, make the k-3 look bad)
---------- Post added 06-08-17 at 02:51 PM ----------
There's a lot to like about the k-x. Look through the k-s1 viewfinder, then look at the resulting shots, you'll be gobsmacked. There are better bodies out there, but save your cash, put it towards a lens that can match the k-s1 sensor.