You could edit sudoers so the command doesn't require a password. But really, at that point I'd just leave Gatekeeper off.