Just had engine rebuilt by PIE Performance, obviously depending on what damage there is will greatly vary cost, mine had head crack, the repair and rebuild was relatively cheap, but its all the other things you will do while engine is out, IMS, Clutch Flywheel, Oil separator, rings, bearings, chains, tensioners, gaskets etc.
I would budget labour costs at £3k, then its parts from there, my bill came in just shy of £10k.
There are some upgrades i would recommend whilst there, later tensioners, low temp thermostat, 997 oil pickup spring, high flow oil filter, 997 sump baffles or deep sump kit to name a few.