You could do it with a combination of a few techniques. The first would be a function to move the cursor to an arbitrary position in a text area:
function setCaretPosition(elemId, caretPos) {
var elem = document.getElementById(elemId);
if(elem != null) {
if(elem.createTextRange) {
var range = elem.createTextRange();
range.move('character', caretPos);
range.select();
}
else {
if(elem.selectionStart) {
elem.focus();
elem.setSelectionRange(caretPos, caretPos);
}
else
elem.focus();
}
}
}
The above code is from this blog post, which I had to use the google cache to view. Next you'd need to find the current cursor position in the textarea.
Finally, using the current cursor position, you could get the indexOf() the carriage returns in relation to your cursor position and use that to move your cursor down 2 lines.
Pretty it ain't, but it should work.