As I've already prepared some pics anyway, I've decided to first analyze the
caves of the third video. After that, I'll try to approach the topic in a
systematic way, analyzing how exactly the BD engine works and how some of
its properties can be used for cavescanning order tricks!
So let's continue with video 3!
https://www.youtube.com/watch?v=wsodCJ2xUHM&t=62s
Cave 21 ("Pandora's Box") starts, of course, at 0:00. Here's the map:

What do we see?
A fire- and a butterfly are trapped inside small "bottles" and they can
obviously only be released together. Rockford is, of course, very much
interested in the butterfly's treasures, but there's a catch in form of a voodoo
that the firefly will directly head to when it's released. So what to do?
Rockford switches sides so he releases the flies from the left side, and he does
so exactly when the flies are ready to go out. Why is he taking that much of a
risk? And why is the firefly going back into the bottle while the butterfly comes
out?
How does it work?
1. Why doesn't Rockford just release the flies without thinking or any
specific timing?
This question should be easy to answer for the cavescanning-order-fan!

The firefly is located above the butterfly, which means it is scanned first every
frame. So the firefly will usually come out first and directly kill the voodoo
before Rockford even has a chance to make diamonds! This means, as always,
that Rockford needs a trick!

2. Why does the butterfly come out first in the video, in spite of what we
just discussed?
Here's the trick: Rockford waits until both flies are ready to come out...

...and only now digs the dirt to release the flies! Where's the difference? Let's check the cavescanning order:
1. The firefly is scanned before Rockford, so the dirt is still there and the
firefly can't come out! (Instead, it makes a right turn without moving.)
2. Now it's Rockford's turn, who digs the dirt.
3. The butterfly is scanned after Rockford, so the dirt is gone and the fly
is free to move out of its bottle!

Voilá - we tricked the cavescanning order so the butterfly came out first!
3. Why doesn't the firefly follow the butterfly out but moves back into its
bottle?
To answer this, let's analyze one more frame from the last picture:
1. The firefly is first again. It would still like to come out, but this time, it's
blocked by the butterfly! Enerved, it makes another 90 degree turn and now
faces into the bottle.
2. Rockford's turn. He has to escape the butterfly, of course.
3. The butterfly moves right.
I failed to prepare one more picture, but you can imagine that next frame, the
firefly would have space to come out, but it has already turned by 180
degrees and faces into the bottle again!
For a fly to make a 180-degree-turn, it must be blocked (from three sides)
for at least two frames, and the firefly was first blocked by the dirt, then by
the butterfly, which was just enough to make it move back into the bottle!

4. Finally, why did Rockford have to switch sides? Couldn't he have done
the exact same thing from his starting position?
I would like to leave this final question to you! It shouldn't be too hard to
answer if you remember our rules about how Rockford may or may not touch
flies...

In the next cave, we'll finally see slime for the first time! The cavescanning
order rule we'll approach there might even be useful for the original
Boulderdash 2, cave E! See you then!
