A version of this proverb was known by the 3rd century BC. Quintus Ennius wrote: 'Amicus certus in re incerta cernitur'. This translates from the Latin as 'a sure friend is known when in difficulty'.
The Oxford Dictionary of Quotations lists it as existing in English from the 11th century. The earliest version I can find is from Caxton's Sonnes of Aymon, 1489:
"It is sayd, that at the nede the frende is knowen."
The morality play Everyman also contains similar lines. The play's date is uncertain and scholars place it as 'late 15th century', which could be before Caxton's work:
Fellowship: Sir, I say as I will do in deed.
Everyman: Then be you a good friend at need;
In the 16th century the proverb was recorded as follows in John Heywood's A Dialogue Conteynyng Prouerbes and Epigrammes, 1562:
Prove [that is, test] thy friend ere [before] thou have need; but, in-deed
A friend is never known till a man have need.
Before I had need, my most present foes
Seemed my most friends; but thus the world goes
So, what does that evidence indicate in terms of original meaning? Ennius' text is ambiguous and, being a later translation, can't be considered the original source of the phrase in English. Caxton's version is also unhelpful. The Everyman play is clearer in its intent and supports interpretation 2. Heywood's verse can't be considered the original meaning as the other citations predate it, but is nevertheless worth considering as Heywood was an indefatigable recorder of proverbs as understood in England in the 16th century. It is safe to say that, whatever view we have now, in 1562 either 1 or 2 was the accepted meaning.
Neither interpretation 3 nor 4 appears to be supported by early texts and, as neither is widely accepted today, it seems safe to discount them. On the balance of evidence, interpretation 2 has the best claim to be the original meaning of the phrase, that is, 'a friend, when you are in need, is someone who is prepared to prove their friendship by their deeds' .
A search of web-based material shows that 'a friend in need is a friend indeed' has about twice the public currency than does 'a friend in need is a friend in deed'. Those who stand up for the latter are probably correct, but they will have a hard time changing the mind of the 'indeed' contingent.