When should you repeat the same subject in a compound sentence?
The second option seems better. I would also like to suggest a change. " I've recently sold my first book, a period drama which I wrote years ago, and have another book optioned. To address your first concern, you can use an additional 'I' , it's not grammatically incorrect. It's just that in English we try to minimise the repetition of the same word in a sentence as much as we can.