Return value should be assigned to caller's valOld instance
(conventional idiom to work around the fact that Lua can not pass
plain data types by reference).
The logic of this function is motivated by the need to support "naive"
invocations that do not explicitly set both valNew and/or doSet.
e.g. local res = self.Atttribute() must deliver the old value.
e.g. self.Atttribute(25) must set the value to 25.
At the same time, invokers that explicitly set both parameters must
also be able to control the attribute. The basic approach is that
setting requires a non-nil new value but can be blocked by explicitly
using a false doSet.