I am having a hard time figuring out your analysis of the code. Rather, you can convince yourself that the running time will indeed be O(N) by the following analysis:
For storing N elements, you will resize the array after the 2nd, 4th, 8th, 16th, 32nd, 64th, .....2^x element, where 2^x = N.
Thus, x = log_2 N
At each resize operation a cost equal to the size of the array is incurred. Thus the total resizing overhead can be expressed as:
cost = 2^0 + 2^1 + 2^2 + 2^3 ......2^x
= (2^x-1)/(2-1)
= 2^x - 1
= 2^(log_2 N) - 1
= N^(log_2 2)-1
= N-1
= O(N)