Welcome to the community!
One way to get the current page is to use ad_conn https://openacs.org/api-doc/proc-view?proc=ad%5fconn
like this for example: set current_url "[ad_conn url]?[ad_conn query]"
hope this helps Brian