A couple of tricks turn this normally complicated and lengthy level into a very straightforward and short one. First, gatehack saves time over the using the stairs:
For this reason, it's ideal to enter 2-4 with at least one egg. If you don't have one, though, you can easily fetch one at the beginning of the second screen by lining Yoshi up underneath one, holding up, and then pressing Y and rolling your thumb down to B. Yoshi's fully extended tongue will clip through the wall and grab the egg.
If you struggle with perfect flutters, a common simpler strat is to use one of the ghost shyguys to perform an extended flutter instead:
In the warps category, running along the ghost enemies into the horizontal pipe at the end of the second screen triggers a warp. Doing the warp skips the boss, and saves about 20-25 seconds.