What was keeping the Bozeman inside the loop before the Enterprise-D showed up?
The Bozeman was only in the loop for the same amount of time as the Enterprise: 17.4 days.
The resulting explosion (caused by the two ships colliding) seems to extend to a distance of approximate 3-4 light years in every direction on both sides of the rift. Ironically, this sort of paradox, where a temporal effect precedes a first-cause is almost exactly mirrored in the final episode of TNG.
Per the episode script:
Geordi: Worf refers to a "distortion." If this were a temporal distortion, and if we were close enough to it... it's possible that a large enough explosion might've ruptured the space-time continuum.
We collided... exploded... and got stuck in this repeating loop of time.
The episode is not entirely clear about whether the Bozeman was caught in the same causality loop for 90 years as opposed to 17 days, or whether it happened into a time warp that landed it in the Enterprise's path 90 years later. In the episode, the Bozeman's captain, Bateson, says that their "sensors detected a temporal distortion. Then your ship [the Enterprise] appeared." While Picard then speculates that the Bozeman may also have been in a temporal causality loop like the Enterprise, this is not explicitly established. (See the script at http://www.chakoteya.net/NextGen/218.htm, an unofficial script-transcribing site. I don't have access to an official screenplay.)
Rather than assuming that the Bozeman was in a 90-year causality loop, one could just as easily interpret Bateson's statement as evidence that the Bozeman entered into a temporal anomaly and emerged 90 years later in the Enterprise's path, and then spent 17 days in the same causality loop as the Enterprise. Given the equivocal manner in which Bateson explained the Bozeman's presence in Picard's era, and the presence in canon of time-traveling Federation vessels (see, for example, the Enterprise C of Yesterday's Enterprise), this seems to me an equally plausible explanation. This also makes more sense because each iteration of the Enterprise's causality loop was dependent upon the Bozeman's presence and interaction with the Enterprise; the Enterprise was only available to the Bozeman to collide with for 17 days, which means that the Bozeman was in the same causality loop, for 17 days.
It comes down to the personnel on board the Enterprise and their unique combination of abilities. La Forge and his visor, Crusher and her curiosity, Data and his positronic brain, Troi and her empathic ability all combined their clues and with 90 years advancement in diagnostic ability over the Bozeman helped them to solve the puzzle.
In the end it came down to Data sending the clue to himself in the next loop (the number 3, the number of Riker's rank pips) in order to end the cycle and break the loop. The Bozeman had no such combination of abilities and no Data on board. He was the real key to escaping the loop.
The Bozeman was trapped because they never realized they were in a loop or didn't figure it out in time before getting recycled and forgot all they learned. Even if they came to realize what happened in one loop they wouldn't be able to communicate with the next loop to change a critical choice to break it. The difference was the personnel aboard the different ships. Setting aside the 90 years advanced technology advantage and consider the players. Enterprise has a 1/2 Betazoid, an Engineer with a high-tech prosthetic and an android with a positronic brain collaborating to communicate with next loop.
If not for Data's ability, the Enterprise could have been forever trapped with the Bozeman in that loop.
For some reason, I was under the impression that the Bozeman was caught in the loop for 90 years, but I think I like the explanation already said here that they came through the temporal rift - going 90 years forward in time as a result - and then got caught in the loop by colliding with the Enterprise. Assuming this is the case, I still have one question, though. Once the loop is broken, why doesn't the Bozeman just turn around and fly back through the rift to get back to its own time?