Scaffolding put up outside Midlothian council headquarters after a piece of masonry fell from it two years ago has cost the local authority over £316,000.