He was safe that time but it is bad practice to leave a snake free and unsupervised in a room. I would not leave that in there either, it's exactly what I'm talking about. They will often try to squeeze into places too tight. Even if he fits now he will quickly grow to a size where getting stuck will be a serious danger.