Escalafy uses a single cost per product, not two batches with different costs side by side. There are two ways to handle it, and both are valid.
Option 1: keep the old cost
Keep the previous cost until that stock is roughly sold out, and only then change it to the new one.
Option 2: enter an average
From the moment of the purchase, enter the average of both. For example, if you have 20 units at $7 and buy 20 at $5, you enter $6.
If you want your history to be more precise, you can reprocess 45 days with the old cost and then reprocess only the days after the change with the new cost.