Step 1: Use virtual work instead of a force balance.
Let the block move a small distance $\delta$ up the incline. Because the string wraps around a movable pulley fixed to the block, both segments of string on that pulley shorten by $\delta$ each, so the single string segment on the hanging mass side must lengthen by $2\delta$, meaning $M$ drops by $2\delta$.
Step 2: Write the virtual work done by all the forces.
At the point where the block just starts to move up, the forces doing work are the weight of the hanging mass (positive, since it falls $2\delta$), the block's weight component along the incline (negative, block rises $\delta \sin\theta$ higher), and friction (negative, opposing the $\delta$ motion, at its limiting value). The virtual work equation at the verge of motion is $$Mg(2\delta) = mg\sin\theta\,\delta + \mu mg\cos\theta\,\delta$$
Step 3: Cancel $\delta$ and solve for M.
$$2Mg = mg(\sin\theta + \mu\cos\theta) \implies M = \frac{m(\sin\theta+\mu\cos\theta)}{2}$$ This is the same relation a direct force balance would give, which makes sense since virtual work is just equilibrium written in energy form.
Step 4: Plug in the numbers.
$M = \dfrac{50(\sin 30^\circ + 0.3\cos 30^\circ)}{2} = \dfrac{50(0.5+0.2598)}{2} = \dfrac{37.99}{2} \approx 19.0$ kg.
Final Answer:
Whether you track forces or virtual displacements, the block needs a hanging mass of about 19.0 kg to just start moving up the slope.
\[ \boxed{M \approx 19.0\ \text{kg}} \]