This code reloads the level when Yoshi eats certain sprites. You can specify up to 255 normal and 255 custom sprites to block.
The reload code itself is from Thomas's "L+R Reload" UberASM code, but I've included the necessary parts. You need to put LRRestart.asm in UberASM's library folder. Also, uses 2 bytes of free RAM and a hijack that can be removed by patching unpatch.asm to your ROM. If you want it to reset to the midway point correctly you will have to check the "Use separate midway point settings" flag for the level. There are a few customization options in both LRRestart.asm and yoshi_eating_reset.asm.