If my iPhone 4 has spyware on it will encrypting my sms messages with an encryption app keep them private?
It is extremely improbable that your iPhone 4 with the latest software, without jailbreak, has a spyware on it, especially if nobody else than you had physical access to your phone after jailbreak.

However if someone has remote access to your phone communications through "encrypted" messagging apps should be quite safe for itself, but if you have a spyware on your phone be sure that someone could see you screen as you see it, for example when you type and read messages in the "encrypted app".