A couple of things... is it a realy M4 or an AR15? They are essentially the same but there a some things that make an M4... well... an M4 as opposed to the more generic label AR15.
Also, 556 is more expensive than 223. Few newer AR's are 223 only. The rule is, a 556 can shoot 223, but you a designated 223 rifle should not shoot 556.
Beyond that, get the real deal. Resale value is higher on the 223/556. It's an investment. Also, I look at pretty much any weapon I buy as a dual purchase. I buy them because I want them, but they also serve a need... a more serious one... i.e., protection for any myriad of events... plausable and maybe not so much. I'm not sure what a 22lr version is going to do for you besides allow you to have a rifle that looks like a "real" one.
Now that being said, you can do what I do. I have a 22lr bolt conversion that allows me to run 22lr out of the rifle. It works on every AR I own and is nice if you just want to spend the day practicing fundamentals which I highly encourage you to do ... a lot.
I'm going shooting Saturday. I just bought a 1000 rounds of Federal (Lake City) 223 for $349. That's not horrible and is considerable better than it used to be. M855 556 is still around 45-55 cents per round mark from what I can tell. I bought a 1000 rounds of Privi Partisan M855 about a year ago and it cost $700 if I remember right so it's better, but not by much... but at least it's not quite as hard to come by these days.
One more thing to consider... a lot of optics designed for the AR have bullet drops calibrated for 223... usually 62gr rounds. That'll be not affective with 22lr. There might be optics calibrated for 22lr on an AR, but I don't know of any, though a normal Red Dot such as AimPoint or Eotech or quality versions of those from Primary Arms and Vortex will work just fine.
Bottom line, I say if money's an issue, just save some more and get the "real" deal for lack of a better description.
My 2 cents.