I guess you have stop(); actions at the end of each scene, otherwise Flash would automatically play the next one in line. So one way of achieving your goal would be to set a variable differently when each button is pressed and to check that variable at the end of the second scene, and re-directing the movie to play the appropriate scene.
Button A:
on (release){
_root.scene_togoto = "Scene 4";
_root.gotoAndPlay("Scene 2", 1);
}
Button B:
on (release){
_root.scene_togoto = "Scene 8";
_root.gotoAndPlay("Scene 2", 1);
}
Then on an ending keyframe of Scene 2, you would add something like:
stop();
if(_root.scene_togoto == "Scene 4"

{
_root.gotoAndPlay("Scene 4", 1);
}
if(_root.scene_togoto == "Scene 8"

{
_root.gotoAndPlay("Scene 8", 1);
}
Now this would only work if your buttons are on the main timeline. If you ever put your buttons in movie clips, or they're inserted in external movies loaded on other levels, targeting scene names, would not worked. You'd have to use frame labels instead. You would label the first frame of each scene with an unique label (no number only labels or at least not starting with numbers), and target that labeled frame rather than the scene name. Thus if the first frame of Scene 4 was labeled with something like
start4 and the first frame of Scene 8 with
start8, then the above script would be changed to:
stop();
if(_root.scene_togoto == "Scene 4"

{
_root.gotoAndPlay("
start4"

;
}
if(_root.scene_togoto == "Scene 8"

{
_root.gotoAndPlay("
start8"

;
}
This labeled frame method would work even if the buttons were on the main timeline, so you might as well get used to use it everywhere.
So if the first frame of Scene 2 was labeled with
start2, then...
Button A:
on (release){
_root.scene_togoto = "Scene 4";
_root.gotoAndPlay("
start2"

;
}
Button B:
on (release){
_root.scene_togoto = "Scene 8";
_root.gotoAndPlay("
start2"

;
}
Regards,