David Zambonini wrote a whole article on the timings for this which became a part of Based On An Idea... (Iirc). I'll see if I can dig up a link to the pdfs. But! A lot of that timing info made it into Sim Coupe.
Most of it's simple stuff - wait for the line interrupt for a specific line, or if you're doing stuff in the upper or lower borders, use the Frame interrupt for upper, and use line 191 for lower (and just pad until you get to where you want). Single pixel effects in the border only really work in the upper/lower area, and are done by turning the screen off. The ASIC latches and emits a new border color 1/2 a mode 3 pixel before the screen is turned to black, so you can play tricks with that to get thin pixels.
