The value for $uid was still in scope during the HTTP_RESPONSE message, so it had the correct value (same reason the add_persist value keeps it's value of 1 between CLIENT_ACCEPTED and HTTP_REQUEST). The logging messages I put in place verified this.
Also, the CLIENT_ACCEPTED stuff wouldn't really work for my case as we can have multiple clients using the same $uid (the uid indicates an application instance, and that application can be shared between users).
Actually, I'm going to take a few steps back, going back to the original iRule. When using this iRule we *are* seeing the persistence table records created correctly, so it looks like just doing the `persist uie $uid` call is adding it to the table correctly. While monitoring it the persistence values themselves are correct, but BIG-IP doesn't seem to be honoring it. The persistence is set up, but it's doesn't seem to be affecting the connections.