You'll need an "exit" event for the last line in your table. You'll need to check to be sure that it isn't empty, and that it's the last line. Then after you add the line (if necessary) you'l need to set the focus back to the first column in the new line.
Bonus: You'll probably want to be able to have the code check to see if a line is empty (and not the last line) so that you don't have a bunch of empty lines.
If you'd like some code help, PM me what you're starting with.