Is it possible to alter the data passed into a Rule? I have a bunch of Rules and some things require a bit more complex logic than usual. What I want to do is use a hook that runs when a particular rule fires, access the data that's passed in to it and manipulate it accordingly so when the rule executes it does it with the manipulated data. I looked through the Rules API and tried some of the function but none seem to have what I want. Is there such a function, or this there a better way?

A simple example: For a rule that sends an email, I want to hook in to it, check some stuff with code and then change the email address it sends to.
I think there are no hooks in rules by which you can achieve it. So you have 2 possible solutions.
1) In rules use the php code for action (Not recommended for security)
2) Use custom module to perform the action rather than using rules.