During the stealth mission you don't necessarily have to stay away from all the lamps, just the ones with Pirats sitting on them. That being said, a blinking lamp is the same as an "off" lamp, but just keep in mind that if its blinking and turns on, you will be caught. But if you watch and its been on, starts blinking, that's as good as an "off" lamp.
My best advice for that mission is just take your time, 300 seconds is plenty of time to finish it.