I think awk would be a good approach to this, as it is great for processing columnar data. I'm not on a computer with awk at the moment, so I can't verify that the syntax will be perfect, but... awk 'BEGIN{OFS="\t"};{if ($1==chrA && $2==startA && $3==endA){endB=$6} else {print chrA,startA,endA,chrB,startB,endB;chrA=$1;startA=$2;endA=$3;chrB=$4;startB=$5;endB=$6}}; END{print chrA,startA,endA,chrB,startB,endB}' boogens.txt.
This requires that the file be sorted by chromosome, then by start and end position (first for file A, then file B). basically, for each line, if columns 1-3 don't match the previous line's columns 1-3 (stored as chrA,startA,endA), then first print out the stored values (prints an empty line in the first iteration, could put an (if NR==1) check if that bothers you), then store the values. If the columns do match the previous line's columns 1-3 (so it is the same peak in the first file), then it only updates the end coordinate. I think this should work (barring a syntax error), with a little tweaking.
EDIT:Sorry, I forgot a pair of braces in the main statement (surrounding the if/else statement). More importantly, I changed "...&&$3==startB..." to "...&&$3==endA..." in the if statement, because that's what it needs to be. My bad.