NOTE: since the recent Android 4.4 releases (for example CyanogenMod 11) you may have to go in Settings -> Privacy -> Privacy Guard (or equivalent App Ops feature) and push for a few seconds on the SMSFailFix slot in order set "Write SMS DB" to "Allowed" (as shown in the third screenshot). This app will not be effective if "Write SMS DB" is set to "Denied" (i.e. the default setting in CyanogenMod 11). After allowing "Write SMS DB" you may want to start the app just once, like if it was the first time you run it after installing it. The procedure described in this paragraph to allow "Write SMS DB" takes only a few seconds and it works fine on CyanogenMod 11. Android versions older than 4.4 don't require this procedure.
Android doesn't always use the correct Service Center number configured in your phone to deliver your SMS. Android can use erratic information included in the received SMS to override the Service Center number configured in your phone. That tends to systematically fail with certain carriers, especially when replying to foreign numbers or while travelling abroad.
This app should be launched once after installing it and then you can forget about it and everything will just work fine.
On the first launch it informs you if it had to adjust any SMS that could have been preventing you to reply to SMS. After the first launch you should already be able to successfully reply to SMS.
After the first launch the app runs automatically only during message reception and you don't need to manually launch it anymore.
The only way to disable it is to uninstall it.
All this app does is to clear the problematic information stored in the SMS database that could lead to an override of the Service Center number. It guarantees you that only the Service Center number configured in your phone will be used to send SMS. This sounds safer regardless if you ever had SMS delivery failures or not.
The problematic specification (that this app disables) is described in the Android source as "rule from TS 23.040 D.6".
This app is open source and released under the GPL version 2.