Points to remember when having to write recommendation letter yourself
The ethics of the question is moot here; this practice is widespread, and the questioner is asking for a solution to his problem, not for an ethical reform of the international academic community.

The guidelines for such a letter would be identical to writing any other letter of recommendation. If you must write your own and have a professor sign off on it, read up on how to write a good letter of recommendation and follow any tips you may come across. You probably have little to no experience writing letters such as this one; there are many subtle nuances, both in what you say and in what you don't say. Take the time to write it correctly. If you find yourself completely stuck, ask someone else with experience to write it.

If you're having difficulty writing a letter about yourself, imagine you're writing about a colleague who has done all the things you have done. It may make the task easier.

Regarding trying to mimic the professor's style, if he asked you to write your own letter, then he likely asked all his other students to write their own letters. There will be no consistent style, and that will be a reality of this individual's letter. If the department/faculty member receiving the letter has received letters from this professor in the past, this likely will count against you, and you should consider that when asking this person for a recommendation.