Distance between elements on different staves
Shouldn't be a thing that happens. There needs to be a boundary or a frame on each staff, determined by the lowest and highest elements - not notes - belonging to each staff. If an element from another staff violates that boundary, the staves should be further apart.
Or at least, that's the solution I'm suggesting.