JSFiddle: working code
your first problem, going top on second click is because you need to cancel the behavior if its the second click in a row. and you also need to add $("#listingB").scrollTop()
value to the animation value cause once you are scrolled in B listing your calculation will not work as expected. laslty, if you need to show the center of the element, you should calculate the height of it and add the half of that value to scrollTop. here is how you should do it:
var i;
var clicked;
for(var i = 0; i < 200; i++) {
$('#listingB').append('<div id="listingB_item_' + i +'" class="items" data-num="'+ i +'"></div>');
$('#listingB_item_' + i).html('item number ' + i);
$('#listingA').append('<div id="listingA_item_' + i +'" class="items1" data-num="'+ i +'"></div>');
$('#listingA_item_' + i).html('item number ' + i);
}
$('.items1').click(
function() {
if($(this).data('num') != clicked)
{
clicked = $(this).data('num');
$('#listingB').animate({scrollTop: (($('#listingB_item_' + $(this).data('num')).offset().top - $("#listingB").offset().top) + $("#listingB").scrollTop() + ((parseInt($(".items").css("padding-top")) + parseInt($(".items").css("height"))) / 2) + 'px' )}, 'slow');
}
}
);