Much simpler: Have the station as your (next) route destination. Warp to instadock bookmark then engage autopilot. When you land immediately without delay the autopilot will request to dock and you dock right away zero delay regardless of lag.
(Note: You will have clear feedback and confirmation of turning autopilot on as Aura vocally stating the fact as well as you get the text notification as well on screen so you will be assured you dock up no problem.)
On my Jita thief alt blinking yellow after stealing stuff this always worked for docking up at Jita 4-4 countless times never once got popped or even locked despite lag and bunch of gankers around so if it works there with thousands in local, busy grid, lag and whatnot without a flaw then it should work everywhere else too.