If I recall correctly, 1998 to 1999 jimnys were g13 motors. If you want m series, you'll need 2000 onwards. 2005 is the first year of the electric transfer case (4x4 gearbox), so if you're after manual selection via stick not a button, 2004 is the latest you can go. Don't quote me on this as I'm not sure, but the VVT m13 may have been introduced in 2005 also, but maybe later. 2000-2004 are definitely non-VVT though.
I went through this as well a little while back when I was looking for a jimny and I had the exact same requirements. Except 2005 is the year of the interior redesign which I preferred, but came with the electric transfer which is definitely not preferable. I ended up getting a LWB Sierra instead
