Get ( ActiveFieldContents ) will do this for you.
From FileMaker Help:
When the focus is in a repeating field, this function returns the contents of the active repetition. The result type of the active field depends upon the data type of the active field and the result type assigned to the Get(ActiveFieldContents) calculation function.
I should add that you don't need the GetAsNumber() functions.
All calculations assigned to $local or $$global variables are of type text; but FM will implicitly interpret these text variables as necessary (e.g. $index = $index + 1 is fine).
I believe that you still need to use GetAsDate (or GetAsNumber) when working with $variables holding dates. (The same would apply to Time and Timestamp.)