sorry for the late reply!
This is a shorthand which is defined in include tcmcs2000. Apprantly RETIFNOTOKT(some.function(...)) is shorthand for call some.functon(...) if the function returns a NOT OK - ie a value not equal to 0 - then return true (T)!!! Why there is a need for this shorthand I cannot say but it is almost the same as follwing:
l.ret = some.function(...)
if l.ret <> 0 then
In your case if entered item is lot controlled and a specific lot must be entered (whinh210.lsel = yes) then the flag whinh210.tlot.is.mandatory is raised (returns true) otherwise it is not mandatory to enter the lot (returns false)