Your code works as posted I ran it as a file. I was able to get it to work in the REPL by adding some explicit semicolons:
Object allSlotNames := method(
result := list();
object := self;
while(object != Lobby,
result appendSeq(object slotNames);
object := object proto;
);
result;
)