However, because you are creating an entry in the persistence table based on the ssl sessionid, each time you change pools in the irule, a new load-balancing decision will be made, and the old persistence record overwritten with the new pool member.
This means that you will not have persistence within each pool, which may not provide the solution you need.
You could use cookie persistence (using the default cookie persistence name), because this includes the pool name in the cookie name, and you can have separate persistence information for each pool. The browser will have two BigIP persistence cookies, one for each pool.
You should ensure that you enable a oneconnect profile on the virtual server, to ensure that a load-balancing decision is made per HTTP request.