I can't guarantee this 100%, but I think that's hard-coded. I once looked for this same script when trying to modify the player's skill progress (the one that get's reset after serving jail), and all I found was a deprecated "servejail" function, that had some developer comments about "hopefully this will be temporary", meaning skill progress couldn't be controlled by scripting after all.
So, I don't know about putting you in front of jail, but I can almost assure that hitting the bed in jail calls some kind of hard-coded scripting, so depending on what you're looking for, you may not find it.
That's what I thought. I was searching like half a day and didn't find anything usefull. I stumbled across the same script as you 'JailBedScript'...
Spoiler Scriptname JailBedScript extends ObjectReference {hopefully temp script to serve jail time}Faction Property CrimeFaction Auto {crime faction that owns this jail}int jailTimeimport GameMessage Property JailBedMsg Auto Event OnActivate(ObjectReference akActivateRef) if akActivateRef == Game.GetPlayer() ; jailTime = CrimeFaction.GetDaysInJail() ; TEMP: jailTime = 10 if JailBedMsg.Show( jailTime ) == 0 serveTime() endif endifendEvent
...the problem was I didn't found the object or quest or which ever reference that controls this script. I also found the message belonging to the bed, it's named 'JailBedMSG' and it reflects exactly the message you get when activating the bed in jail. I don't necessarily think it's hard coded. Could just be a script that doesn't have a regular name, there are tons of them.
I also found tons of instances in certain quests, factions, packages, formlists and dialogues, but none that controls the event I'm searching for. There are also references jail markers that controls the teleport in between serving jail time, but no trace of the wanted script.
I finally included a spell to my mod, so that you're able to fix the bug players get by your own.
What I did in my mod was giving weight to arrows and whenever you serve jail time the arrow weight dummys get duplicated after you're released from jail. It doesn't happen when you escape from jail though.