hook it up to an oscilloscope, so you can see the firing pattern, i suspect it may have something to do with loss of energy/power, see if by any chance the backfire gets worse when the lights are on, also diconect the battery for about a minute so the adaptations reset on the ECU, of course that is done with all off.
if the back fire continues look into the alternator not having enough output to maintain charge, make sure terminals are secure and clean. also there is a body to engine ground at the starter that normally gets forgotten on engine swaps.