Grade 8 theory is certainly a tall order if you are attempting it without a teacher to guide you. But as others have already said, the answer book that came out for the 2007 past papers should give you some idea of how good your theory skills are, and how close you are to getting a good mark.
The first three questions in the exam paper are essentially about style.
In Q 1, completing a Baroque trio sonata entails adding notes which fit the figured bass as given, but you must do so 'in the style of' the given material. So, as mentioned before, keep your eyes open for imitation as it should feature as a possibility somewhere, and any sections you add should blend seamlessly with what's already there. Given rhythmic ideas can and should be used to your advantage - in semiquaver passages for example, try to continue with the same rhythmic idea. And remember - the writing is likely to be for strings, so leaps are mostly ok, but remember to keep within the compass of the instrument (violin bottom note is the first G below middle C, for example).
In Q 2, completing a piano piece involves much the of same skills, but in a different context. You must keep to the given style, and your writing should blend in with any given material. Not having a figured bass to guide you is both an advantage and a drawback, as you have to decide which chords to use. Primary triads (I, IV & V) are the most likely to be of use, but don't forget that secondary triads and seveths are needed too. Cadences should be identified and completed as fully as possible - use full harmony, and make sure to complete the triad (for example, in the tonic of D minor, you should have all three notes in evidence - D F & A; the dominant triad needs A, C# & E, plus the seventh G, if appropriate). Writing for piano allows more freedom in the range of notes available to you, so don't be afraid to use a wider compass, but keep to the given style at all times.
In Q 3, continuing with the melody is again a test of your skill in maintaining agiven style. Modulations are a good idea, and in a melody of between 12 and 16 bars, you are probably going to modulate at least twice, but this is not hard and fast rule. Many people prepare a plan in advance - for example, modulate to the dominant by bar 4, the relative minor / major by bar 8, perhaps the subdominant by bar 12, and so on. others find this too restrictive, and prefer to be influenced by the material in fron of them on the day. Given the restriction on your time in an exam setting, I feel that the more prepared you can be the better. Use a variety of cadences too - perfect, imperfect and interrupted should all attract good marks if executed correctly. Other than that, the advice already given in this thread will help you a great deal.
Best of luck with grade 8 theory.