The cost of legalising each property depends on what is wrong with it. Mine cost about €1,000 fine to the government to legalise and €1,000 fee to the civil engineers who did it but it had very little wrong. The declared size was about 9 sqm less than the actual size, one corner was 2.4 m from the boundary fence when it should be at least 2.5 m and I had put up a tiled pergola to act as a car port very close to the boundary. The last could have easily been removed but the 10 cm breach on the corner of the building could not be easily rectified and meant it could not be fully legalised so I went for the 30 year rule and left the car port in place. The engineers who did it said that mine was the lowest fine they had dealt with up to then but I have since heard of slightly smaller ones. Unless there is nothing wrong at all you could probably assume €1,500 would be a lower bound for legalisation. Mine is inside the village boundary therefore there was no issue of splitting plots so I am not sure what that costs but it is largely Notary's fees so it shouldn't be too expensive.
I know of people who were initially told it would cost about €50,000 just to legalise their property because there was so much wrong with it and another civil engineer told them that in his opinion it could never be legalised. In the end they found a buyer and got it legalised for a lot less than €50,000 but I am not sure of the exact amount, possibly around €20,000. That was built on an enormous plot, much bigger than 4,000 sqm, so no question of split plots.
I know of one split plot case where one half didn't want to sell so were not prepared to pay anything. The people who did want to sell had to pay for both properties to be legalised, i.e. fines and civil engineers fees for both, Notary's fees for both properties to be split, since each property needs a new contract, and to pay off all outstanding debts of the people who did not want to sell. That was under €50,000 but not a lot under I believe. That is the most expensive I have heard of so you could assume it will be less than that.
I know of several other cases that are in the few thousand Euro category.
Sorry but it is not possible to give a precise answer.