It is indeed possible to have UIWebView execute arbitrary JavaScript and to capture any value returned as a result. I'm not sure I fully understand what the nature of code you're executing is, though, so I've just demonstrated the basic approach below. If you can provide more concrete details about the type of JavaScript logic you're hoping to execute I may be able to help more.
UIWebView *webView = [[UIWebView alloc] init];
NSNumber *q1 = @20;
NSNumber *q2 = @30;
// Create a simple JavaScript addition statement.
NSString *javascript;
javascript = [NSString stringWithFormat:@"%@ + %@", q1, q2];
// Note, the result will always be an NSString
NSString *result = [webView stringByEvaluatingJavaScriptFromString:javascript];
// result is @"50"
I also want to correct some terminology. You said "JavaScript code embedded in a JSON file". Actually, the JSON notation format can only contain name/value pairs. It can not contain executable JavaScript code. Perhaps you meant to say you were loading JavaScript files from the server?
Finally, when executing code loaded from outside your application like this you should always take appropriate technical design precautions to protect against malicious JavaScript that someone may try and trick your app into loading.