From your description, it's possible that your cat may have a form of feline hyperesthesia, even though he's not exhibiting all the signs. Here is more information about this condition:
Typically, with this condition, a cat will take off running for no reason and his back will be very sensitive and will twitch and/or 'ripple.' He will furiously lick at his back and try to bite his tail and hind legs. His pupils might dilate (become very big) during one of these 'attacks,' so watch for this. This condition is considered neurological and likened to seizures.
When you describe your cat suddenly biting his feet, this may be caused by an allergy. He may have a fungal or bacterial infection between his toes or under his claws, so check these areas for any redness, black color, oozing, bleeding, foul smell.
When he's on your lap, purring and you're petting him and he suddenly starts to bite you and then your knees, he could be 'overstimulated.' This means that he's had enough of the petting and wants you to stop. If he does have hyperesthesia his back is very sensitive and touching it too much, triggers these reactions.
It would be a good idea to have him checked by his vet in person, at this time, so you can explain his behavior and try to find the reason for his reactions. The vet will evaluated him from head to toe and if hyperesthesia is suspected, the vet will either refer you to a veterinary neurologist, or your vet will suggest a medication to help with these symptoms.
I hope all will be well with your furry boy!
Please be so kind as to rate my answer with positive feedback, as that is the only way I receive recognition from the website for my assistance. Thank you very much!
Providing a positive rating will not end our conversation, should you need me for any follow-up. Simply click 'Reply to Expert' for clarification or additional information, if needed.