Mergesort with an inversion counter
Use nconc instead of append for speed in

(setf merged-list (append merged-list (list a)))

Note that you need setf with nconc only if merged-list is nil.
Use pop: instead of

(let ((a (first lower)))
  (setf merged-list (append merged-list (list a)))
  (setf lower (rest lower))))

you can write

(setf merged-list (nconc merged-list (list (pop lower))))
The combination of let and loop creates extra indentation for no good reason. You can use with clause in loop to create bindings instead, or use the do macro.
Usually predicates are named with a -p suffix, so I suggest that you rename your small-list to small-list-p.
Please fix line breaks and indentation in the third cond clause.