OP asks:
What is the syntacti[c]al function of the word translated as "sleep"? Is sleep the time (or metaphorically the mode) of giving, or is it the gift itself?
I think this is an excellent question. Unfortunately (as expected given the variety of translations), I think there is ambiguity in the original which will preclude drawing a certain conclusion, but I can at least explain the problem. The text:
שָׁ֤וְא לָכֶ֨ם
It is vain for you
מַשְׁכִּ֪ימֵי ק֡וּם
to rise early
מְאַֽחֲרֵי־שֶׁ֗בֶת
to sit up late
אֹ֭כְלֵי לֶ֣חֶם הָעֲצָבִ֑ים
eating of the bread of sorrows
כֵּ֤ן יִתֵּ֖ן לִֽידִיד֣וֹ שֵׁנָֽא
for he gives (/will give) to his beloved sleep.
The problem with this literal translation is that in English, the word "sleep" unambiguously the object of the verb נתן = to give. In Hebrew, like in English, objects often follow verbs, and an English direct object may be the most straightforward translation. However, there is another possibility in the Hebrew that is not represented by this English.
The ambiguity arises due to the existence of the "adverbial accusative" in Hebrew. That is, a noun in the accusative (i.e. object) position can function as an adverb.1 Walke & O'Connor2 tell us that such constructions
detail features of the verbal action (and the like), including time, place, condition, manner, and specification.
"Sleep" then could mean "as they sleep" or "during sleep" or some such thing. So the (OP's English translation of the) German rendering
because he gives to his (chosen) in their sleep
is also plausible from the Hebrew.
Incidentally, another answeranother answer pointed out that the word "ὕπνον" ("sleep") is in the accusative in the Greek text. While this is true, Greek also does know of an adverbial accusative, more prevalent in older forms of Greek compared to Koine, but not infrequent in Septuagint Koine, as one might expect from the source language.3 The Greek Psalms also follow the Hebrew syntax rather slavishly, so I'm not sure how much we can draw from the Greek accusative.4
The OP also asked about the tense of "giving" in Hebrew -- this is "imperfective". Hebrew is largely an aspectual rather than a tense-based language, a topic which I am not competent to expound on further, but the basic idea is "incompleteness", whether past, present, or future; most often it is translated as present or future.
Notes
- Such phrases generally seem to me (a native English speaker) to be missing a preposition. When there's no apparent alternative, my brain just fills these in. When there is a sensible alternative, as here, my brain favors the option that has all the needed words in place. But of course, my sense of what is "needed" is biased by English.