If you're trying to collect response content and replace multiple instances of one string with another string of a different length, it gets pretty complicated. You need to update the indices for subsequent matches based on the length of the current replacement string.
Fixing the app or upgrading the BIG-IP and using the newer stream commands would be ideal options. If you try the payload option and need to replace multiple instances of the search string, let me know and I'll see if I can find a past rule we used.
Aaron