On my 3520b the outside of the headstock 10 1/2 x 8. There is an inset in the top of the headstock that measures 9x6 7/8. I built a box with a bottom that fits into the insert. I can send pictures if you send me your email.
Distance from floor to top of headstock is 51 1/4" in my shop. But I have my legs adjusted on the high side so YMMV.
I just updated my posting with a link to a dropbox album. I never did that before. See if the link will give you, and anyone else who cares, access to the pictures.
I measured mine also to compare. (PM 5320b) I have a giant vernier caliper.
It wasn't clear how your box is going to fit or fasten to the headstock. If it just needs to sit on the top, no problem!
However, if you want your box to have a lip that fits over the top of the headstock the shape is actually a bit complicated. Both ends along the ways are bowed slightly, with middle the widest at just over 10-5/8". I can read metric better on this caliper so the widest place is just over 26.9cm. It narrows towards and away from the front of the lathe to about 26.7cm.
The back edge of the top is actually bowed in slightly while the front is bowed, wider on the left: 20.6cm, center: 20.5cm, right: 20.35cm.
Also, the front right corner is not rounded like the rest but made with a diagonal vertical flat, about 25mm on each side.
If your box is going to overlap the top a bit there is not much space. The vertical face on the front is just 20mm from the highest point to where it meets a curved fillet. The vertical face on the back is about 23mm to the top of the VFD housing.
Also, since these are castings, they may all be slightly different!
If you want your box to fit in the shallow recessed space left when the rubber mat is removed, I didn't measure that but I can if you want.
I use rare earth magnets all around my shop, and in various projects.
Magnets would not be advised in this particular setup because the item sitting atop the box is a laptop computer. I will be using a strap to secure the box to the headstock.
This is just a temporary setup for the demonstration. In practice, the computer is on an independent platform just behind and above the headstock.