shut the door with window UP? surely that'll break the glass?
I think if the door is open, the CCU will not let the window go fully up, it'll go up as far as where it drops to when you open the door. But don't hold me to that!
Plus, given the strange behavior of your window, all bets are off!
When you say it only works with the engine on, is that with the engine running or just the ignition turned on?
There's obviously a wiring fault somewhere. It sounds like with the ignition/engine off, when you close the door, the CCU goes to wind the window up (normal operation), but the signals/feed gets corrupted and it winds the wrong way - the wrong wire is energised.
I can never get my head around why, but often these sorts of wiring/electrical confusions in the system are caused by poor earths. There is an earth behind the rear 1/4 panel interior trim by the rear door hinges - I presume the window operations would use that. It may be summat to do with that. You could try taking the wires off it, cleaning it and the connectors up and putting it back together.
I believe also that there is a dual relay setup behind that panel for rear window operation. Its a while since I read up on the window operation (when I had problems with mine) but there's a feed for turning the motor 1 way and another for the opposite - energises different wires to the window motor - there may be an issue with these - but I can't think why a problem would only manifest itself with no ignition feed.
Personally, I don't think the problem is with the CCU. I think its more likely to be in the wiring in/around the door. I'm no expert though.