Modifying entry with 'onBeforeSaveEntry' event
Sprout SEO is a conjunction of different fields when you save an entry it will send the values from the Sprout SEO field (title, description, ogImage, etc..) in the 'metadata' namespace. So, in order to override this value, you can follow the next example:

craft()-&gt;on('entries.onBeforeSaveEntry', function(Event $event) {
    $entry = $event-&gt;params['entry'];

       if($entry-&gt;type['handle'] === 'service'){
          $serviceContent = $entry-&gt;linkToService-&gt;first();

          $seo = $entry-&gt;getContent()-&gt;seo;
          $seo['metadata']['optimizedDescription'] = "Override description value";
          // Update it in the post request
         $entry-&gt;setContentFromPost(array('seo' =&gt; $seo));
      }
});


In this example I override the 'optimizedDescription' you can see all the properties in the 'sproutseo/models/SproutSeo_MetadataModel.php' File.

Remember that you can also override any value on the front-end using Template Overrides or add a Custom Format to specific values like the title or description using twig logic on your Sprout SEO field settings