Sorry to hear of your troubles, definitely not fun
I am not sure where you're located, or who you're sourcing the engine from; but around here most of the major wrecking yards will offer an extended warranty on major components for a nominal cost (couple hundred bucks depending on the total cost of the component). I bought a Mercedes differential from Standard Auto a few years back and while I can't recall exactly what I paid, for a reasonable cost they extended the typical 60 day warranty to a 3-year xx,xxxkm (sorry, don't recall the km term) warranty.
Now, the warranty only covers the part, not the labour, and if you did claim the warranty they would either source you a comparable component to replace it or refund your original purchase price.....Might be worth it in your case.