Just a minor detail I'm not sure has been posted yet:
Objects in the .osb file take prescedence in the layering over the .osu files, but only within the four nominal layers. That is, let's say I have pseudocode in the .osu file:
Sprite,Background,Centre,"object1.png",x,y
_M,0,0,1000,x,y
Sprite,Foreground,Centre,"object2.png",x,y
_M,0,0,1000,x,y
And in the .osb file:
Sprite,Background,Centre,"object3.png",x,y
_M,0,0,1000,x,y
Object 3 will appear above object 1 (since they're both in the Background layer and the .osb file takes precedence), but not above object 2 (since object 2 is in a higher layer). You can think of it as (and this is probably how it actually happens) the game loading the .osu file's events, then appending the .osb file's events afterward. Thus, since the .osb events are necessarily further down the list in the layer, they appear on top.
Something to keep in mind if you're doing difficulty-specific scripting.