Play in the folding tip, a loose clamp on the shaft and a broken side stand sensor pin are three different parts. They can't be lumped together into one "pin" repair.
What is known from experience
A folding lever pin falling out at around 12–15 thousand km has been described. That mileage isn't a mandatory replacement interval: the actual clearance, the state of the rivet and signs of falls matter.
How to tell the causes apart
With the engine off, check the folding mechanism, pin retention, spring and the lever's fit on the splines. The tip must fold and return while keeping full shifting possible. A random bolt can bind the joint or touch a neighbouring part.
Checking the result
When replacing the pin or lever, make sure it's retained and moves freely. Carrying spare fasteners is only useful if their sizes have been checked in advance. After assembly, check the travel in your boots; play coming back means assessing the hole, not just fitting a new nut.