All very good advices, TB. And yes, that is a classic case of a barrel roll. For both the defending side and the attacking side, judgement between the speed difference is crucial. All I can add is a few pragmatic pointers in actual application:
1. Obviously, as a defender, you must not pull this move if the enemy is slowly closing behind you - unless you are absolutely sure the attacker is poor in skill and will be overshot.
That is because, if the enemy has more or less simular skill level as you do, he will probably anticipate a reversal coming and slow down so he does not overshoot. And of course, in that case you become a sitting duck.
2. A plane that is generally poor in maneuverability compared to the attacking plane must not try this reversal unless, as above, you are sure that the attacker is poor in skill.
Even if you have succeeded in the initial reversal, a better maneuvering plane can immediately go into a hard maneuver and quickly shift its position behind you again - or, if the attacking pilot is very skilled, he could go into a even wider barrel roll than yours as he is being overshot and bring back the situation to right where it was in the first place (even worse!).
3. Generally, this type of reversal is usually wielded by skilled people in maneuverable planes who boast excellent gunnery. They see a plane closing behind their six fast and then at the crucial moment, pull a barrel roll. As the enemy overshoots and passes into the front he tries a long tracking shot behind the extending enemy.
4. As Wldthing said, it is generally very poor judgement to pull upwards after you realize you've been suckered by this move. Skilled pilots lure you into a situation where the margin of speed difference slowly diminishes - this means, more often that not, the margin of difference in the energy state between you the attacker, and he the defender, becomes minimal, or even non-existent as you are being overshot.
In panic, generally inexperienced pilots pull upwards - which, in trying so they are exposing themselves into serious danger. Even worse, is after being overshot, they pull upwards, and then sees the enemy behind at 600. They get scared so they keep pulling the stick, and enter a loop - which in that case, 9 times out of 10 they end up dead.
5. The most dangerous enemies who use these moves, are those in Spit9s or N1K2s. Those planes aren't particularly fast, but have the ability to maintain fast speeds once they have gained enough speed in the first place. They disregard rule #1 above, and bravely try a reversal when the enemy behind is closing in slowly, not fast. If they succeed, you are overshot and extending away from them at a slow speed(since when you approached him in the attack run, you were closing in slowly). You're chance of survival immediately drops near zero if they have the ability to snipe planes at over 400 yards.
6. Therefore, you must develop a judgement on which enemies are gonna try a reversal, and which not.
Generally, the ones who will try reversals, are the ones who you know that he saw you coming. For instance, when you were approaching him from another angle, he reacts and maneuvers. But as you approach him again from the 6oc position, he suddenly seems to act dumb and starts a shallow dive without any movement. 9 times out of 10, he's planning a reversal. Looking behind, seeing the range closing, and at about 600~700 yards he goes into a barrel roll that drops under, not floats over. Be prepared for that.
7. There are many variations to these moves. The most favorite one by many pilots is entering this type of sudden barrel roll during a turn. They see an enemy behind them. They enter a shallow, spiralling dive with a wide radius. The speeds for both the attacker and the defender builds.. and as the attacker comes closer, the defender pulls into a tighter turn so both of them near the verge of black out. And then, as the attacker enters a hard lead turn to get a shot in, the defender suddenly enters a quick barrel roll and the tables can be turned decisvely.
8. Much simularly, this move can be pulled off during a dive - both planes enter a near verical dive, the attacker chases. But the speeds build very quickly so black outs are imminent. As the attacker closes in, the defender chops throttle, gives full rudder, and starts a powerful roll - in this case the attacker overshoots during a dive so it is very deadly. I've pulled this one off against Typhoons in a Fw190 - the Typhoons are very fast divers, but roll poorly. The 190 retains a good roll rate upto very high speeds.
9. Another variation, is a barrel roll during a full 90 degrees verical - this one's extremely hard to pull off, but feels like a million bucks if you succeed. When an enemy plane is behind you at a very close distance, and when both you the defender and he the attacker are fast, and you somehow manage to avoid his bullets. In those situations, you can try a very sudden pull upwards. He'll try to follow you. Both of you will most probably enter momentary black out. But as you pull, you give hard rudder and enterl a wide roll - you can see the enemy coming straight up behind you, and then overshooting you during a straight vertical, and pulling in front of you helplessly. It's a maneuver very hard to see in AH, but more easily seen in IL2/FB.