Too Long, Didn't Read
Assuming ordinary circumstances, there are not new or used Pentax camera bodies that will substantially improve focusing at the described budget point. 1
Overview
The K50 has weather sealing, front and rear dials, a 100% viewfinder and compatibility with every Kmount lens ever made.2 Of those, Canon's entry level cameras provide EOS lens compatibility. Nikon's entry level cameras offer none. But that's not really a fair comparison because the K50 provides image stabilization to all those old lenses because Pentax puts image stabilization in the body rather than the lens. Putting image stabilization in the body allows Pentax lenses to be simpler designs.
Focusing
The down side of the tendency toward simpler lens design is that most autofocus Pentax lenses rely on the focus motor in the camera rather than having an ultra-sonic motor built into the lens. Lenses with autofocus driven from the camera tend to make more noise and to focus more slowly than lenses with ultra-sonic motors. Perhaps relevant here is that having a motor in the body is part of what allows the K50 to be compatible with all Kmount lenses.
There are Kmount lenses that rely on ultra-sonic motors rather than the in-camera motor. These tend to have a reputation for faster, quieter, and more accurate focusing. Partially because they tend to be targeted above the consumer level.
Ok a bit more about focusing
Any autofocus lens will achieve faster more accurate focusing in proportion to the amount of available light. A kit zoom with variable maximum aperture will struggle more when zoomed out because the aperture will tend to fall between f5.6 and f6.3 and those tend to be right near the limit of what DSLR autofocus requires.
Motion blur is often mistaken for lack of focus. Because DSLR's are complex (as photography often is), some photographers will set the camera into automatic modes when attempting to shoot under difficult conditions, for example moving subjects like people indoors under low light. Often lack of sharpness is due to movement during the long exposure times that the camera chooses when set in an automatic mode. No DSLR has an image stabilization system that allows hand holding for 1/4 of a second and no person will hold perfectly still for 1/15 of a second without deliberate effort.
Recommendations
The biggest upgrade in terms of focusing are experiment, practice and research. Taking photos to see what works and what doesn't makes it possible to learn how your camera's focus works and how it doesn't. Research into the specifics of your camera in particular and into photography in general will help interpret the results and understand why some shots work and others fail. That some shots work and other shots fail is just the way it goes. Most great shots are missed. Most shots that are not missed are not great.
At the specified price, there are similar Pentax cameras to the K50 with newer features and slightly better numbers. None are likely to provide significantly better focus capability because the limiting factors affecting focus are inherent in physics and engineering. That's not to say that there are not entry level cameras from other manufacturers that might offer marginal improvement in focusing. But those improvements will tend to be realized statistically across a large number of photographs -- perhaps a few more "keepers" every thousand images, and who is going to notice that? Most of that improvement will come from different lenses.
Speaking of different lenses, if money were burning a hole in my pocket that is where I would consider upgrading. Lenses with wider apertures will tend to autofocus more accurately. Lenses with ultra-sonic motors will tend to have better autofocus. At the budget point, you can probably buy one weather resistant fast lens.
Another option is to spend the money on a photography class. Technique solves a lot of focus issues.
Remarks
Switching gear makes it harder to learn how to use the equipment one has. I really like this essay.
With digital, taking lots of images has about the same cost as taking a few. All the real cost is in learning.
Focusing is always an issue. There's always ground glass with a tripod.
Reference
A 100% of crop of Scarlet, shot yesterday with Pentax K50 and HD PENTAX-DA 55-300mm f4-5.8, WR. Handheld at 150mm focal length for 1/60 second. Indoors using available light (not much) at f4.5 and ISO 6400. It is the only "keeper" out of eight shots.

1: I am excluding ergonomic differences such as articulating screens, control locations, etc. that improve focusing technique due to the particular way the camera is used.
2: The latest lenses with electronic aperture control may require a firmware update. Some very old Kmount lenses may have an additional pin that needs to be removed to avoid problems. Some manual Kmount lenses with an A
setting may require shifting the camera focus mode switch to MF
in order to remove the lens.