Как раз когда - just when..., как раз - just then
That puts it into perspective. The uses of 'when' to introduce subordinate clauses and 'then' to introduce independant clauses are basically the same in English, as far as I can tell.
I could translate 'Как раз когда...' as 'and it was at that moment that...' which I think serves the same purpose as 'just as':-
'... - He cried, just as others arrived'
'... - He cried, and it was at that moment that others arrived'
I think I'm right about that. I'll look at it again tomorrow when I'm less tired.