If the problem is to find the first element of list L1 which is also contained in L2, run through the elements of L1 one-by-one and check if the current element is in L2. The second test ("is element in L2") can be either done by a simple loop over all elements in L2. Or you put all elements of L2 into a hashset first, which can speed-up the process fairly.
Now it should be obvious that you can switch roles of L1 and L2 when you are looking for the first element in L2 which is also part of L1. And if you are looking for a common element from one of the lists which has the lowest positional index either in L1 or L2, run both steps described so far, and if you find two different elements, choose the one with the lowest index in either L1 or L2.
This approach has one disadvantage: if L1 and L2 are huge, and you have some non-common elements at the beginning of each lists, you have to read either the full list L1, L2 or both, even when there are some common elements among the first elements of L1 and L2. So the idea of your solution above is to use the following subsets:
K1(n)="the first n elements of L1" (or L1 if n>length(L1))
K2(n)="the first n elements of L2" (or L2 if n>length(L2))
with n running from 1 to
max(length(L1),length(L2) and check if K1 and K2 have a common element, for each n. The smallest n where K1(n) and K2(n) have a common elements shows you that either the n-th element of L1 or the n-th element of L2 is the element you are looking for.
It should be obvious that when K1(n) and K2(n) are disjoint, and you are going from n to n+1, you only have to check if the new introduced
n+1st elements from L1 and L2 are in K2(n+1) or K1(n+1). The use of a fast hashset data structure for K1 and K2 which is incrementally extended keeps this process fast even for bigger n. And if you found a common element for a certain n, you can stop the process immediately. That is what you described in your post.
This approach will work fairly fast even when L1 and L2 have, for example, more than a million elements, but the first common element in both lists is among the "top ten" in both lists. It won't save you much when L1 and L2 do not have any element in common, but that is also true for any other approach.