^ Spot on. The native Close button is only present in VIEW mode, and none of the native Client Script entry points fire in VIEW mode.
To do this, you'd have to make a User Event which attached a Client Script in VIEW mode, and then the Client Script would have to hijack the Close button click using DOM methods, which are not officially supported - or make your own Close button as Anthony suggested.