Oraclize employee here, and looking at your code with a
__callback I'm pretty sure the Oracle you are referring to is indeed Oraclize, so hopefully I can help! :p
Without seeing the rest of your smart-contract I can't diagnose for sure what is stopping your
__callback from running, though I can certainly make some educated guesses. It is almost certainly failing due to out-of-gas errors since you're using both
strings & a loop inside it. Any string manipulation is very expensive in solidity in terms of gas, and looping over some form of string manipulation is will multiply that cost for each time the loop turns.
When you call an Oraclize query you have the option of supplying an amount of gas to the query, which amount is taken from your contract at the time you make the call. (This is different to the
setCustomGasPrice that you've mentioned) Oraclize will then supply this amount to power the transaction that runs your
__callback. If you don't supply this parameter, it defaults to 200,000. That's plenty to run your
__callback with most of the logic removed, but unlikely to be enough depending on how long your string result is & how many times you iterate over it with in the loop.
To supply more gas to the Oraclize query, add the number as a param thusly:
oraclize_query("URL", queryString, gasAmount);
gasAmount is a uint of how much gas you wish to supply & the
queryString is whatever you're currently using to make your queries. This way you can add more gas to the transaction and get the
__callback to go through when it includes your logic.
However, the bigger issue is that you're trying to do a lot of expensive stuff in your
__callback, and the name of the game in Solidity is tying to make everything as efficient as possible since it all costs money to run. It's probably worth you having a look at your current architecture & see where you can make gas-cost savings in what you do with the results of your Oraclize query.