That won't work. Substitutions are ran before the code is ran. You'll need to use PHP for the condition itself. You've full access to Joomla and CB API from your Code action. For CB that would be the following, but you may need to provide the full namespace path to our functions.
Code:
$eventname = $event['title'] . ': ' . ( in_array( 18, Application::User( (int) $event['user_id'] )->getAuthorisedGroups() ) ? (int) CBuser::getUserDataInstance( (int) $event['user_id'] )->get( 'cb_marketing_multiplier' ) . ' €' : '2 €' );
With full namespace added:
Code:
$eventname = $event['title'] . ': ' . ( in_array( 18, \CBLib\Application\Application::User( (int) $event['user_id'] )->getAuthorisedGroups() ) ? (int) CBuser::getUserDataInstance( (int) $event['user_id'] )->get( 'cb_marketing_multiplier' ) . ' €' : '2 €' );