I think this is fine - I don't see why having the `end`s on separate lines would make it easier to understand:
if ...
if ...
if ...
if ...
if ...
x = 1
end end end
y = 2
end end