Two ideas:
1) You can create a configuration profile with VPN on demand. This require client certificat authentication though. My guess that if some application will try to access domains or hosts defined in VPN on demand section in sleep mode, VPN will be turned on.
Update: At some moment Apple was sued regarding VPN on demand, so I believe they dropped this feature and after returned it back modified. It's good idea to read this article for iOS 7: http://support.apple.com/kb/ts4550
2) Idea which I offered for this question (iOS6 toggle WiFi on non-jailbroken device). Here is the copy of text from there:
I think it make sense to look at SystemConfiguration.framework.
It has set of API to work with different connection interfaces, which are defined here: http://developer.apple.com/library/mac/#documentation/Networking/Reference/SCNetworkConfiguration/Reference/reference.html
This one is private API.
Update: I believe there were some changes in SystemConfiguration and Apple tightened security around this framework.
3) Apple may grant to some applications additional entitlements, so they can build functionality which no other application can build. As example, VPN client companies (like Cisco) got special entitlements to build what in iOS called "VPN plugins", which is essentially VPN client.
"keep alive"
. That's the usual term to describe that you don't want a connection to be closed, which is one way to solve this problem. – Outdoors