Couple of things ... someone just asked this question on here... (answered maybe 15 minutes ago), and your INSERTS don't work.
if you use ROW_NUMBER() and partition by the UserID column and the date, you should get pairs of login/out. if you use ROW_NUMBER() on that, the evens are IN, the odds are OUT.