No time now to down load your code and look!
THis sounds like your modem is set for local echo.
Check the switches etc.
In "Local Echo" mode, every character typed was echoed by the modem. This was used in the "Old Days" when we used to use dumb terminals. The echo let us know what we typed.
This can also be set "Off" on some modem via an AT command. Sorry, I don't remeber what the command was.
Along with the above, the "OK" should not come back until after the modem sees an Carridge Return (enter).
Some modems where also "case sensitive". Watch for that.
Ben
Ben