The condition application result waits for the application to finish to use the result returned to determine how to act on it. The action just fires an application but does not wait for it to return. Therefore any changes to the mail file will not be updated after the application is finished.
Based on what you have said content filtering won't do what you need but you can use antivirus filtering to perform this task. Create an antivirus scanner which uses your application with appropriate parameters including "%s" to pass the temporary email file. The important bit is that you tick the option Scan Raw Email Data as this does a scan of the entire mail and also allows the antivirus scanner to alter the mail; with antivirus filtering the temporary copy of the email is actually used instead of the original to allow these file edits to remain. Your application should also return a value (e.g. 0 or 1) then you should set the antivirus scanner to use this return value to indicate an infection so that the changes are made permanent. You can untick the Scan Text and HTML Parts option as this isn't needed here. You also shouldn't need to add any further actions to the antivirus scanner unless you need any other action taken.
Of course as always you can feel free to send me your contentfiltering.ini or antivirusfiltering.ini files to
chris@code-crafters.com for me to check after you have implemented these changes.