Hand-made interface to SWD to write flash of ARM chip
I'm going to configure SWDCLK as normal output, and SWDIO as an open-drain 


SWDCLK is OK, but SWDIO is bidirectional and not open drain. That means you must be able to switch from output to input mode and vice versa.


  is there minimum allowed clock period?


Usually not, but some devices have minimum clock rates for special functions like unlocking.


  I would be also thankful for short sample of commands sequence to read / write the flash


That is specific for each device. OpenOCD supports many different types (both microcontrollers and programmers) and has source code available. 

I have already ported Versaloon to the LPC1343 MCU on the CCC R0ket, this might be a simpler starting point.