The while loop uses linear search to scan backwards. However, we know that the array within the while loop is already sorted. So we can replace the linear search with binary
insertion sort pushes the elements of the array in order to free a space to the next element in line.
so if you find where to enter the new element using binary search, you will still need to push all the elements after that index one step forward (to the right).
so given an array sorted backwards: 10,9,8,7,6,5,4,3,2,1
you will need to make i-1 pushes to the right in order to insert the i'th element (even if you use binary search) - worst case time: O(n^2)
if you could insert the elements, one by one, to a list you wouldn't have to push the elements, but you will have to "pay" for the search of the proper location in the list (so in this implementation W.C.T is O(n^2)).
a solution to this problem will be with some kind of synergy between lists and arrays so you could reach the i'th element in O(1) time (as in arrays) and could push a new element to a given location (say after the index j) in O(1) time (as in lists) - if you succeed, I believe you will win eternal glory!