i dont know how exactly either, but i can supply a hint
http://openvpn.net/index.php/open-source/documentation/manuals/69-openvpn-21.html#lbAR
you could write a script which checks what lan you are on, and decides whether or not it should go further with connecting