A service manual for the K2 can be found here:
Pentax Manuals
With a camera of this age the most like reason for the problems you are having is dried up lubricant, I know the shutter speeds are electronically controlled but there are still mechanical parts involved and if the mechanism cannot move freely then the electronic timing will not be correct and it will probably be inconsistent as you have found out..
It is therefore important that everything moves correctly before starting to make adjustments, likewise any corrosion or wiring problems need to be sorted out first.
The preset resistors under the bottom cover are unlikely to need adjusting but if you do intend to alter them make sure you mark their positions first so that you can always reset them to original settings.
The usual tolerance for shutter speeds of this type is +/-25% for speeds below 1/125 and +/-30% for 1/25 and faster.
Also bear in mind that the system you are using with phototransistors and Audacity whilst giving a fair indication it is not the most accurate and could easily account for another 10% of error or more.
Almost all Pentax cameras of this era have a 1/125 shutter speed that actually measured nearer to 1/90 even when new. This came about because of the market pressure at the time to be able to advertise a faster flash synch speed and the only way they could achieve this with the shutter mechanism was to slow things down a bit and then lie about the speed.
Good Luck