I have an M2 Air, and I love it. It does everything I need in a machine I travel with including gaming, local AI image generation, photo & video editing. However, at this point I'd recommend going with the M4 since it's almost certainly going to be supported for around two years longer than the M2.
The only reason I'd change my opinion on this is if you were using the difference between prices to justify a more expensive M2 with a larger SSD. But if you're sticking to 16GB of RAM and a 256GB SSD regardless, getting the M4 seems like the better plan.