The best way to get the last value from a column/indicator in an event is with Now:
Output Now(Momentum(Close,50)); #return the value for Momentum(Close,50) for the current bar
and if you want to go futher bar in time, you can use Ago:
Output Ago(Momentum(Close,50),5); #return the value for Momentum(Close,50) 5 bars ago
Both Now and Ago return a value, while Ref returns a column and you would typically use Ref when building indicators.
The error, ”Too many arguments for reference-type operator ” is due to you using “ref” rather than “Ref”.