Capt Pitt Bull,
A great reply fully of factual information and plain old common sense. Indeed, approaching level off is where most TAs and RAs occur, and as such a vertical response (or, in fact, sound vertical management to avoid it in the first place). I avoided such an RA recently. A very light 777-300ER going up like a homesick angle, actually went into ALT mode 2000' below the level off, still doing over 2000fpm. The only way to reduce it's VS was to disconnect the AP which I duly did.
Most of the responses, however, are rather heavy on the assumption of immediate ATC availability and high traffic density. I spend a lot of time CPDLC over India, using dodgy HF in Asia, or OCTA in Modadishu airspace. Night before last I was no-coms for over an hour out of Jakarta, up to 40NM off course avoiding CBs. In these sort of circumstances, had I detected opposite direction traffic which was going to infringe, a right turn as per rules of the air would, in my opinion, have been the correct thing to do right up to the point of having to comply with an RA.
I believe we are negative training these days, teaching people to sit and wait for an RA to save them. It works if everyone does the right thing, it can lead to tragedy if someone doesn't.