Unfortunately there doesn't seem to be any direct answer to this.
Valka doesn't really detail the years spent away from Berk. Just that she rescued dragons, learned about them, and stayed in that particular nest (or if you prefer, the Sanctuary). How she got there is never really explained, but the clearest implication is direct, that Cloudjumper was part of that nest and brought her directly back.
There are a bunch of potential answers that could cover the gap, but they are all speculative:
- The Bewilderbeast's nest could have run short on food, prompting the raid where Valka was taken. She'd already made a good start in convincing them she wasn't food, and would've just stayed.
- It could have been the Nightmare's raid as were all the others in the first movie, but she may have influenced Cloudjumper into not returning (there being no doubt she'd be eaten if that happened), and found Sanctuary later.
- Cloudjumper may originate from another nest entirely, now that this movie demonstrates there's more than one, which pretty much leaves it open for anything to happen to Valka in the intervening years, as well as any story bit you like from the first two possibilities.
Regardless of your preferred answer (I'd think the first one myself), that would make this a bit of a plot hole.