I just did something similar yesterday, I think. Please see the attached images. I create a grid of people, and set the sprite frames and text labels based on a JavaScript object, similar to yours. I wrote a "parser" function to grab the data from the JS object.
What I was struggling with is the type of variables. You must make sure your event function is set to receive the proper return type and also the proper argument types, as the C3 runtime does not seem to do the coercion the same way as JavaScript does. I resorted to using strings only for the communication between JavaScript and C3 runtime and convert them to numbers in the C3 actions where needed.
Check out the "Integrating events with scrips" demo projedct to learn how to set local and global variables.
Hope this helps.