I'm pretty sure you problem is just timing... your wait() loop seems too quick (not even 1ms with those 12Mhz). why don't you use the _delay_ms() from util/delay.h ???
anyway... I think your timing even there is very off... as I remember most commands took at least 100ms to execute, and the quickest way to determine that is, instead of waiting time, catch the "OK" response with the usart...
also after the +CMGS command it takes a variable amount of time (about 1 or 2 seconds) before sending the caret ">" and only after receiving the caret you can send the message text (with the corresponding ctrl+z as you did)...
I suggest you to get one (or two if you can) TTL uart to USB converter (like some FT232boards) (probably the same kind you used to communicate the sim900 with the PC) and check both the uC tx data and the sim tx data (i you can check both at the same time see if you receive a corresponding 'OK' for each AT command) don't forget to check that the uC is correctly sending the data at 9600bps and you didn't mess the crystal freq or the clkdiv fuses in the AVR...