Constrain position of group of wiggling objects within another
Here i created points inside a torus using particle system and animated it using wiggle vector node. Using bvh trees we can find the points which are inside torus, the points outside is replaced with nearest surface point on the torus.
You can work more on nearest surface point to get more smooth animation.