I think this still doesn't nail it.
Prior to this change, the modification coming in later will win.
Now the modification coming in earlier will win.

I think to solve the issue, you have to prioritize delete over insert:

		if insertTs and tonumber(ARGV[1]) <= tonumber(insertTs) then
  			return -1
		elseif deleteTs and tonumber(ARGV[1]) < tonumber(deleteTs) then
  			return -1