Ghosting - or 'shadowing' as it is commonly called - is one of the best non-hitting squash exercises you can do. You can develop your footwork, enhance your endurance, elevate strength, refine your timing. Always try and do it with a racquet in your hand as well because it can also polish up your technique.
Stu demonstrates and explains the benefits in the below videos. Many of the movements do not require a lot of space, although spreading out may be a good idea if you are swinging a racquet - you don't want to be picking up the pieces of that vase you just backhanded through the window.