Give this a try:
https://fcpxtemplates.com/flashing-light/
If you need help installing: https://fcpxtemplates.com/installing-plugins-for-fcpx/
You can limit the effect by using the Effect Masks available and you can add more than one to create alternating flashes:

I apologize for the quality of the GIF... ;) What's going on is two Flashing Lights added to the clip. One has a Shape Mask set on the left side, the other on the right side (plenty of feathering used). Phase for #2 set at 3.1416; Wave Shapes set for Sine (default). Speeds for both set at 150. If this is too much, use the color picker to reduce the color saturations and use a different blend mode.
The effect is pre-set for a pure red color and Overlay blend mode, but feel free to try out different stuff.
Phase is based on 2π, so 180º out of phase is 3.1416. You can ramp the speed up to more than 100 if you like, just grab the number value and drag the mouse up (negative speeds are also possible).
When you get the settings you like: Save Effects Preset to save your settings for future use.
If you prefer to do this without this effect, you can place a Generators > Solid Color over you clip. Set the Compositing > Blend Mode to, basically, anything you like (but start with Overlay). Then keyframe the Opacity to create the flashes.
HTH — fox