I think I've re-derived it now:
http://rtist.741.com/repeated.html
(only read the last paragraph if you don't have time to follow the lengthy derivations).
The results from the contrast package used wrong degrees of freedom in this case.
The A|B1/2 should have about 41.4 df; and B|A1/2 should have 22 df.