Jacob, things on the master page can only be modified directly on master page, unless you are doing thing though code.
My suggestion is add your custom web part to the master page. Then add a Page Selector data field to all your other page types. For the pages that need to show the popup, editor can go to Form tab and select a "pop up" page type page. As for your custom web part on the master page, set it's visible to depend on if that field of the CurrentPage is empty or not. Then you can get the page node from that field and pass to your web part to generate the HTML for popup.