The easy, cheap way of turning off the compressor at 4k is to manually reach over and just turn it off, like we used to do back in the day.
2003 and up A/C request is on a serial data line, so not easy to control with the PCM. Even if you could get it to work, it won't shut it off at 4k, it will shut it off at full throttle. So it would probably be easy enough to mount a full throttle cut off switch on the gas pedal to cut it off at WOT.
Also, as far as I know, the PCM doesnt have a signal for locking the doors when shifted into drive, that would be a BCM and maybe even an instrument cluster function.