AP1 and AP2 in Honda speak refers to the chassis. In the North American market, the AP2 chassis received the F22C engine, whereas the rest of the world continued to get the original F20C engine (Japan did start getting the F22 in 2006). If it were me, I wouldn't put forth the effort to drop a F20/22 into a Miata, I'd just buy a freakin' S2K! Just my humble opinion.
https://en.wikipedia.org/wiki/Honda_S2000