I can't comment on the origins of gokyo. I can say however that I've studied this waza along with the remaining osae since the day I started training.
I've always understood that from a characteristic point of view, gokyo is identified from other osae in the making through the gripping of the wrist and placement of tori's thumb roughly where uke's pulse would be.
I've also understood gokyo to be particularly related to knife defense and this has been reinforced several times when the technique has only been requested in gradings when uke is holding a tanto, indeed I've seen occasions when all of the osae waza are presented (with empty handed attacks) and a tanto requested and used specifically for gokyo.
As an ending, I don't consider gokyo to be particularly effective at pinning or immobilization, I speak from experience having removed a shank from a prisoner using this very technique however, whilst great pain can be induced upon the joints, there isn't IMHO enough control over center for it to be considered an effective immobilization hence, this further reinforces my opinion that gokyo is a means to an end in terms of disarming a knife wielding attacker and not much more.