The "line" property can't be changed in onBeforeEventRender (that's too late). You need to set it in the data source before the Scheduler loads it.
You can preprocess the data like this:
const events = [ /* ... */ ];
events.forEach(e => e.line = 0); // or events.forEach(e => e.line = "dedicated");
dp.update({events});
If you use a number it will use the specified line within a row. If you use "dedicated" it will use a special line for each event and if you use null or undefined it will have the default behavior.