There are some private procs in ecommerce that can help with that:
ec_securelink and ec_insecurelink help with presenting pages from https to http and visa versa.
Some of the other ssl related procs might be useful, too:
https://openacs.org/api-doc/procs-file-view?path=packages/ecommerce/tcl/ecommerce-ssl-procs.tcl&public%5fp=0
AFAIK, the other procs are written to work within ecommerce package, so you will probably need to recode some parts of them to work with your site.