I was looking at different solutions on how to save Apple Pencil's Cap, any of them didn't meet my expectations. I have decided to create something new and unique. This solution allows you to put the original cap into the box and use this standalone solution instead of it.
You should print this with TPU or any other elastic filament. This will allow you to fold it in half. Additionally, it will help you in keeping Apple Pencil on your table.
I have tried to design it to resemble a pencil's eraser. Inside it, I have left place for Lightning connector, what is visible on section analysis.