I'm afraid it's not possible to do what you're asking. The request comes up every few months, and we've never found a way to do this. Mainly, Facebook doesn't want you to do it because they don't want to give the ability to force your users to connect to your application/site. While you're motives may be benign, and even positive by using a reward for doing so, Facebook makes it so that the user has to take each action on their own (click the login button and then intentionally granting permissions).
They do a similar prevention mechanism with their invitation logic (in our JFBCInvite module) to prevent admins from even tracking how many users someone has invited... so that you can't give incentives for having users invite all their friends.
Again, it's possible there's a way around this, so if you manage to come up with something, let us know. Controlling an iFrame through Javascript is going to be impossible though because that's cross-site scripting, and almost all browsers will prevent that from working.