aco: refactor visit_store_scratch() to use new helpers