I use a Pentax K200 and have been satisfied with the original Pentax 18-250 superzoom, for travelling, outdoors, family types of use. However the autofocus gradually failed, the motor going to and fro and being unable to lock on a focus. My local repair people said it needed to go back to Japan, but given its age and the potential repair cost I decided to splash out on the new Pentax 18-270 superzoom. Unfortunately the autofocus of this new lens sometimes doesn't work, on occasion locking at infinity or at the shortest range. Because the mechanism is very quiet, it is hard to know what's going on and why the shutter is not operating. It is very frustrating when the shot is missed. The sympathetic local supplier and repair people had great difficulty in replicating the problem, and proposed I return it and buy another type of lens. I could also return it to Pentax-Japan, but really I would prefer to just keep the lens. Has anyone else experienced this problem? Any advice?
Since the old one was driven by the Camera's motor while the new lens has its own motor (SDM), it's unlikely to be the cam's motor at fault here.
If the symptoms of both lens are correlated, it could be that the camera's phase-detection sensors are damaged or misaligned.
I don't know the K200 (I have a K20) - can it focus with Live View? Live View doesn't use the phase detection sensors but instead looks at the image and focuses on high contrasts. Does that work reliably? If it does, then that suggests there's a problem with the phase detectors. These sensors sit at the bottom part of the inside cage between lens and image sensor, below the mirror. Either the sensors themselves are misaligned or damaged (maybe there's dust on them?) or the mirror, which has a little second downfolding mirror to guide some light to these sensors, is out of alignment (see http://photographylife.com/how-phase-detection-autofocus-works)
So, first thing I'd try is to get a camera air blower and see if you can clean out the bottom area of the black cage.
Also figure out if the mirror is not seating correctly if it's down - e.g, if it doesn't come down completely or if it got warped because you touched it too hard, then the image in the viewfinder won't match what you get on your pictures - the center would not be the same. In that case, you're probably out of luck and need a new camera.
Of course, the simplest and surest test would be, as a commenter already suggested, to get another Pentax body and test your lens on that one to see if the problem goes away.
If the body turns out to be the problem - These older Pentax bodies are not that expensive on the used market any more. Probably cheaper than having the problem repaired in a Pentax shop, I'd guess.