You'd need some other script to actually mark the tunnel disabled before calling the stop, and then marking it enabled again before calling the start.
probably easiest using the developers shell. record a new macro to disable/enable the vpn & then use cron to call that macro
some clues:
config snippet when disabled:
<openvpn-server><vpnid>2</vpnid>
<disable><mode>server_tls_user</mode>
<authmode>Local Database</authmode>
<protocol>UDP</protocol>
<dev_mode>tun</dev_mode></disable></openvpn-server>
config snippet when enabled:
<openvpn-server><vpnid>2</vpnid>
<mode>server_tls_user</mode>
<authmode>Local Database</authmode>
<protocol>UDP</protocol>
<dev_mode>tun</dev_mode></openvpn-server>
so basically you going to need to set/unset the <disable>tag in the xml with something like:
unset($vpnconfig[disable]) ;
or
$vpnconfig[disable] = true;
don't copy past above, it needs some work to … uhm work ;)
https://doc.pfsense.org/index.php/Using_the_PHP_pfSense_Shell
checkbox: https://github.com/pfsense/pfsense/blob/master/src/usr/local/www/vpn_openvpn_server.php#L628-L633
disabling: https://github.com/pfsense/pfsense/blob/master/src/usr/local/www/vpn_openvpn_server.php#L470-L472</disable>