Don't be intimidated by the sound of paint hitting your bunker. Keep in mind that if paint is actually hitting your bunker, it cant hit you. Use those opportunities for a quick head check to locate your opponent and potentially spook them from advancing any further. Paint flying by the edge of your bunker is what is actually a danger to you.
If you are pinned into your bunker by fire, at some point you have to force your opponent to make a shot.
If the person is coming at you while shooting like your outlined scenario implies, all you have to do is be able to snap out of your bunker and put paint on an exposed target. Your opponent is going to have to land a shot on a much smaller target, while moving. You should at least be able to trade out with the opponent even if they land their shot but the advantage should go to you.
Being accurate with your snap shot and being able to discern where the incoming fire is coming from is going to help with this. Drill your snap shot to become accurate and pay attention to incoming fire during games - the ability to pinpoint where incoming fire is coming from and from what range will come with experience.