(a)Where summons is served during construction of an improvement or installation of machinery or equipment on the property taken or on the remainder if such property is part of a larger parcel, and the owner of the property ceases the construction or installation due to such service, the owner shall be compensated for his expenses reasonably incurred for work necessary for either of the following purposes:
(1)To protect against the risk of injury to persons or to other property created by the uncompleted improvement.
(2)To protect the partially installed machinery or equipment from damage, deterioration, or vandalism.
(b)The compensation provided in this section is recoverable only if the work was preceded by notice to the plaintiff except in the case of an emergency. The plaintiff may agree with the owner (1)that the plaintiff will perform work necessary for the purposes of this section or (2)as to the amount of compensation payable under this section.