если вручную прокручиваешь до конца, то при добавлении сообщения будет идти автоскролл. если нет то нет)
<!DOCTYPE HTML>
<html>
<head>
<title>example</title>
<style>
.msg {
padding: 5px;
margin: 5px;
border: 1px solid silver;
}
</style>
</head>
<body>
<div style="width: 200px; height: 300px; border: 1px solid black; overflow-y: scroll;" onscroll="scroll(this);">
<div class="msg">aguadg uydg uerygtuy eguygauyer gauery guae aueaer</div>
<div class="msg">aguadg uydg uerygtuy eguygauyer gauery guae aueaer</div>
<div class="msg">aguadg uydg uerygtuy eguygauyer gauery guae aueaer</div>
<div class="msg">aguadg uydg uerygtuy eguygauyer gauery guae aueaer</div>
<div class="msg">aguadg uydg uerygtuy eguygauyer gauery guae aueaer</div>
<div class="msg">aguadg uydg uerygtuy eguygauyer gauery guae aueaer</div>
<div class="msg">aguadg uydg uerygtuy eguygauyer gauery guae aueaer</div>
<div class="msg">aguadg uydg uerygtuy eguygauyer gauery guae aueaer</div>
<div class="msg">aguadg uydg uerygtuy eguygauyer gauery guae aueaer</div>
</div>
<script>
var auto = false
function scroll (ths) {
auto = ths.scrollTop + ths.clientHeight == ths.scrollHeight;
}
var div = document.querySelector('div'), i = 0;
setInterval(function () {
var newMsg = document.createElement('div');
newMsg.innerHTML = 'aguadg uydg uerygtuy eguy ' + (++i);
newMsg.setAttribute('class', 'msg');
div.appendChild(newMsg);
if (auto) {
div.scrollTop = div.scrollHeight;
}
}, 1000);
</script>
</body>
</html>