a second hand engine will mot likely be in better condition than the one you've currently got. anyone who sells you a 2nd hand engine usually gives a 3-6 month warranty. during that time you can test oil pressure and compression + leak down and if its shagged then they replace or fix it.
the worst thing you could do when on a budget is throw it at some mechanic as 100% of the time they will tell you things like - oh we need to replace the timing belt, tensioners, idlers, engine mounts, hoses bla bla bla and the bill ALWAYS ends up $1000 over what they originally quoted you.