Last time I knew I had a warrant and prepared to turn myself in, I tapered off with subs for a week, while waiting for a bed to open up at a detox. Then once I got done with the detox, I scored 1 more sub while preparing to go to turn myself in and took care of any lingering WDs, then took my final dose of it literally while walking up to the lobby to check into the jail. As stated above you could try smuggling in a sub or two, cuz they are very easily concealable, but do this if you are very slick bro, its a big risk.
Then while going thru the booking process they will ask you if you are on any meds. (Bring all meds with you , they may allow you to have some of them, even narcotic ones, but usually they will put you in medical isolation if you absolutely need them.) Then they will usually ask you if you will be WD'ing from any drugs. This can be a trick question, some jails have withdrawal protocols, some don't. Some may even do you real dirty and put you in isolation and make you kick cold turkey in a cell. I personally couldn't do it. I went crazy cuz the restless legs and anxiety and sweating drove me up the walls literally. I had to get out of there and luckily knew one of the guards from previous stays there and he got me out of there cuz really the isolation made it worse for me. I'm not one of those people who can just lay there and be sick cold turkey. But anyway, the one county jail here Cuyahoga County Jail (Cleveland), has a withdraw protocol for opiates, benzos, and alcohol. Most jails see the benzos and alcohol WD as more serious, cuz it can kill you and they'd be liable for your death if they didn't treat you, but opiate WD doesn't concern them too much cuz its generally non-life threatening, tho you may feel like and even want death. But at this jail I told them I was withdrawaling from opiates and xanax, and they put me on a 4-day taper with tramadol and klonopin. So see if they have a withdrawal protocol, just make sure you find out how they do it and make sure they don't just lock you up and say "see you in a week" cold turkey like they did to me the one time. Terrible.
So yeah, bring all your meds, if you are on gabapentin, I know most jails are friendly with that, and I would cheek them at med call all day, then pop all at once at the end of day haha. But yeah , taper down as much as possible before going in, if you have the balls and are slick enough, smuggle a sub or 2 (highly, highly risky) for those terrible restless nights, and ask what kind of withdrawal protocol they have. Just avoid the cold turkey isolation shit *shudder* at all costs, unless they actually let you have your narcotics in isolation maybe.
But yeah, the main key is taper down as much as possible since you actually have the chance to do so. Sux when you are all of a sudden just plucked from the street in the middle of a bad habit, no chance to taper, then maybe forced into cold turkey WD. Aweful. And oh yeah, best time to go is when your sleep is going back to somewhat normal. God that is the worst part of cold turkey in jail. Last time I did not sleep at all besides 15min cat naps til my 14th day when I actually slept thru a night. I was so brain dead. So best of luck to you dude, I hope I helped, as I have been in that situation many times.