It's a how long is a piece of string question. It depends on what is wrong and what needs replacing and how good a job you want. There must be something wrong if you want to rebuild it. What's up with it?
I'm rebuilding mine at the moment after No4 cylinder injector went dicky, ran hot, melted the top of the piston and had a brief run away

Last night I sat making a list of parts and sourcing prices from different suppliers. I've got two lists, one with parts largely sourced from Turners Engineering
(LINKY) and including key new parts (pistons, injectors etc) and top end OEM parts. The other lists is a lot from Turners, but with some reconditioned parts and cheaper (still OEM) parts from the likes of Paddocks. So far my top end list, just for parts, is £964 and the economy list is £709.
I'm sure there'll still be bits I need though. Oh, on top of that I've already bought new heater plugs, engine stand, brake cleaner, blue towel roll etc.
Have a look on Turners, they do reconditioned engines. You could get one of those and sell yours.