You can selectAll and then forEach, like below. However what you want to do sounds a bit unusual, so without a bit more context of why you are doing that, its hard to know if there may be an alternative approach in general. So if you want you could explain a bit more for ideas, but the code below should help with the specific question how to loop through paths.
s = Snap(400, 620);
var p1 = s.path('M100,100Z');
var p2 = s.path('M200,200Z');
var set = s.selectAll('path');
set.forEach( function( el ) { console.log( el ) } );