As a horn player, there are not too many opportunities to write original cadenzas. I can not think of any pre-classical horn concerti that leaves room for a cadenza. During classical times we have several examples, most notably the concerti of Haydn and Mozart need cadenzas and shorter "eingang"s in several places. Also Rosetti and Punto leave room for cadenzas in their concerti (and I assume some other classical concerti that are not in my active repertoire fall in the same category). As we move on to the Romantic era - a time when instrumental virtuosity often became a goal in and of itself - we are lucky enough to still have concerti written for our instrument. At least two of them have accompanied cadenzas (modeled on vocal recitatives) that are already provided by the composer: Strauss op.11 and Weber op.45. The only other concerto in our standard repertoire that leaves room for a cadenza that can be provided by the performer is the big Gliere concerto.
The reasons are fairly obvious: In baroque times horn concerti were typically written in the clarino range and/or imitating various hunting calls and signals, and only as the hand-technique developed would the horn be suited to carry unaccompanied material of sufficient interest to justify a cadenza. (Let it also be noted that baroque composers did not frequently leave room for this type of cadenza even for instruments that were further along in their development.) As the hand-horn technique was challenged by the invention of the valves, composer's attitude towards our instrument remained in flux for almost an entire century (some composers embraced the new, fully chromatic horn, some remained faithful to the mystique of the valve-less horn regardless of performer's preference, and yet some took advantage of the new developments but sought to keep obvious associations to the natural harmonic series and the instrument's origins.) As we move in to modern times, horn technique is again on firm footing (although several composers are scared to use the instrument to its full capacity due to fears of inaccuracy?), but composers have typically assumed a higher degree of control of their art and the age of specialization dictates clear borders between composer and perfomer - hence no performer-provided cadenzas.
After this lengthy introduction let me get to the practical advice for writing your own cadenza. This is fairly straight-forward information and is based on common sense, personal experience and some reading (mainly the excellent book by Eva and Paul Badura-Skoda "Interpreting Mozart on the Keyboard"). I will discuss 6 elements:
1 Duration: If we are elaborating on a cadential 64 chord we are allowed some time. Take into consideration the total length of the movement. For any of the Mozart and Haydn concerti it tends to get a little weird if your cadenza is longer than 80-90 seconds. Similarly, I think I would feel cheated if the cadenza was less than 45 seconds. For the Gliere concerto, I can handle a longer cadenza (as proven by the video on top of my own effort), not only because the 1st movement of Gliere is considerably longer than those of Mozart and Haydn, but also because it is slightly looser in construction. When we are embellishing on a simlpe dominant fermata, cadenzas (or more correctly; the German "eingang") should be kept very short and not wander into other keys, maybe not even other chords - just simply prolonging the dominant chord (obviously allowing for passing notes, appoggiaturas etc.).
2 Style/Tonality: We have several examples of cadenzas that blend together different styles and even quote or reference other works. When we do this, we typically make a joke. Jokes can be funny, but you need to know your audience, because nothing is worse than a joke that falls flat. Also: If you always and only joke around, don't be offended if people don't take you seriously as an artist.
In other words: Stick to the style of the original concerto!
For horn players this opens another can of worms; do we make our cadenzas playable on the natural horn? Personally I find this to automatically help keep me in the classical style. At the same time I would not object to some stretching of this rule as long as it is done with taste. I would not write melodic lines below the staff, but I could conceive of using "d"s even though Mozart never wrote any "d"s for horn - or even arpeggios on the dominant, even though they would sound pretty muddled on a hand-horn.
As far as tonality goes I think we have more freedom in Mozart than in Haydn. Mozart, for instance, managed to write an extended melodic passage in D flat major for a simple E flat horn, so I find it appropriate to take on a similar challenge when writing my cadenzas. This type of challenge is unnecessary, and might even be distracting, when writing cadenzas for Haydn (or other classical composers.)
3. Content: Badura-Skoda gives excellent advice in looking through the movement itself - including orchestral tuttis - when deciding on your actual materials. The real challenge lies in developing the material and stringing it together. I recommend limiting yourself to three "themes" - sometimes two might suffice. Preferrably they should be of contrasting nature (masculine/feminine, assertive/lyrical etc.). Simply quoting the themes is not going to be very fulfilling - attempt instead to use basic transformations such as augmentation,diminution, sequencing, modulation, fragmentation etc. Sometimes it can be useful to have an "introduction" to the cadenza - a "back to me" moment that is not necessarily directly thematically related to the movement - if so; keep it short. Likewise, towards the end, it is possible to use "generic" technical passagework to create virtuosic excitement.
4: Form: Normal laws of proportions apply. I often find it useful to think of a three-part division into "beginning, middle, end". More importantly, if you use theme "A", theme "B" and theme "C", it would be unbalanced to devote 12 bars to theme "A" and then hurry through themes "B" and "C" in two bars each. As in all composition and performance we need to create a high point. Unlike most other forms, it is normally desirable to have the high point right at the end of the cadenza. Typically I would structure my cadenza as follows: "Introduction" - majestic/virtousic/declamatory. "Body" - two themes interact, room for melodic lyricism. "End" - whipping up some excitement and reaching a high note before cadential trill.
5: Personality: The cadenza should highlight your abilities as a performer. For that reason I would never write a cadenza containing an element I conceive of as a weakness in my playing. Write to your strengths - answer completely honestly "what is my strongest suit as a performer" and make sure that the answer informs your writing. (If your high range is great, there should be high notes. If your legato is the smoothest and prettiest ever, write slurred lines etc). If you follow my advice on staying in the style, chances are your cadenza will be somewhat like someone else's cadenza. I don't think this is a problem. In fact, when writing a Mozart cadenza, there are only so many themes to use and only so many ways to combine them that similarities are inevitable. A starting point for your personal explorations might even be a cut-and-paste approach where you combine elements from other people's cadenzas in your own way. (Obviously, you have to give credit in programs if this is your approach). With time and some repeated effort I think anyone can gain the confidence to write something that is unique and suits your individual style as a performer - copying is a great way to learn; just make sure you copy the best! (And to paraphrase Pablo Picasso: Stealing is even better than copying.)
6: Improvisation: A lot of attention has been given to the tradition of improvising one's cadenzas. Like most people I find it very admirable when someone is able to do this successfully. I do however wonder, how creative one can be in this situation; your muscles would tend to want to do what they are used to doing, which could lead to "trite" patterns. I read one time an interview with a famous jazz-trumpeter who was bragging about how his playing was superior since he was able to think 16 bars ahead when taking a solo. I then immideately thought to myself that by this logic his playing would be even better if he would know what he was about to play half-a-year ahead of time! I think we have all experienced the exceptions to my objections, and if you want to train this ability, you have my deepest respect...
In conclusion I would hope that we are seeing a return to the active performer who participates in the creative process and dares to insert him/herself in the great masterpieces of the past and I would encourage everyone one of us to write our own cadenzas. If your cadenza is not good, just write another!