Huge "it depends". Depends on the condition and what you decide to do with the cylinder bores and pistons. A full rebuild would include an overbore + new pistons. A light rebuild might be able to just get away with a hone and new rings and use the existing pistons.
I'd suspect it'd be cheaper to purchase a used engine over rebuilding what you have.
Bellevue WA
90 535iM - not much stock remains. 3.7 liters, ported head, cammed, 3.73 diffy, M5 brakes, MAFed, yadda yadda yadda
86 Porsche 951 - Track Toy