Measuring emission lines with JWST MegaScience medium bands: a new window into dust and star formation at cosmic noon