In essence this is a vector problem. As the mass slides down the inclinded plane there is a componant of its weight which causes the normal force between the plane and the mass and a componant going down, parallel to the surface of the plane. The only portion of the weight which contributes to the force of the object when it collides with the spring is the parallel componant.
When the mass strikes the spring, the kinetic energy it has will be converted to elastic potential energy as the spring compresses. Because the mass starts at rest, the change in kinetic energy is just the final energy
1/2mVf^2 = 1/2kd^2
Vf^2 = (k/m)d^2
to get the distance down the inclined plane that the mass moves we use
Vf^2 = Vi^2 + 2aL Which simplifies to Vf^2 = 2aL
to get a, we use simple right angle trig to find the parallel componant down the plane a = gsin(30)
We now have everything we need to find the distance down the incline:
L = Vf^2/(2a) =(kd^2)/(2mgsin30) = 200N/nX(.20m)^2/(6kgX9.8m/s^2X0.5) = 0.2721m = 27 cm.