If the slanty part of the inclined plane is 8.0 m long, then the top end is 4.0 meters higher than the bottom end. (You get that with the sin(30) given in the question.)
So the box is 4.0 meters higher at the beginning than it is at the end of the fall.
And that's really all you need in order to solve this.
That, and the formula for potential energy: P.E. = (mass) x (gravity) x (height)
How much more potential energy does the box have at the top of ramp,
compared to the bottom ?
PE = (10) x (9.8) x (4.0) = 392 joules.
That's how much potential energy it loses from the top to the bottom. It doesn't matter one bit whether it falls down straight, or down a slope, or through some loop-de-loops on the way. All you care about is the difference in PE between the top and the bottom. That's 392 joules, and that's the work that gravity did on it to pull it from the top to the bottom.