#!/bin/bash
s="define service{
    host_name               A
    notification_period     F
    }


    define service{
    host_name               A
    notification_period     metrologie
    notification_period     F
}"

sed '/metrologie/{N;/\n.*notification_period/{s/\n.*//}}' <<< "$s"