This will involve more then just creating a few plugins unfortunately. You would basically have to prevent k-relay for closing its connection to the server even if the client disconnects. But then if you dont have something sending the move packet every newtick and whatever else the server requires to keep your character active, the server will boot you.
Now modifying k-relay to keep its connection alive after a real connection has been established would probably be the easier route, although i say easy as in compared to some other method. It would still be relatively difficult to make sure you are sending all the correct packets as needed once you close the flash player.
The other option that i see, which i would say is much much much harder, would be to setup your own program that connects through k-relay to the game without ever loading the flash file. But then you are going to need to learn how to set up rc4 encryption/decryption and whatever else is required to do this. Using sockets/tcp to send packets and everything like that.
Good luck on trying to do this, but its not going to be an easy thing to do unless you are a decent programmer.