I'll make sure you aware of three things that may help ...
1. Multi-Dialog
https://4js.com/online_documentation/fjs-fgl-manual-html/#c_fgl_multiple_dialogs_001.htmlSo you can end up with
FUNCTION ...
DIALOG
INPUT ...
END INPUT ...
CONSTRUCT where1 ...
END CONSTRUCT
CONSTRUCT where2...
END CONSTRUCT
...
END DIALOG
IF ... THEN
LET sql = ..., where1, "AND ", where2
ELSE
LET sql = ..., where1
END IF
END FUNCTION
OK for simple permutations, at its extreme you'd end up with one construct per field
2. ui.Dialog.getFieldBuffer
https://4js.com/online_documentation/fjs-fgl-manual-html/#c_fgl_ClassDialog_getFieldBuffer.html, returns the value of a field, particular useful in a CONSTRUCT
(GET_FLDBUF() is similar
https://4js.com/online_documentation/fjs-fgl-manual-html/#c_fgl_operators_GET_FLDBUF.html)
Be aware of the difference between buffered and unbuffered
https://4js.com/online_documentation/fjs-fgl-manual-html/#c_fgl_multiple_dialogs_012.html. A lot of people get caught out by the fact that in the default buffered mode, the value of the current field inside an ON ACTION hasn't been updated yet.
3. Where there isn't a 4gl method available, sometimes you need to read or write to the AUI tree, see my notes and examples on this topic here
https://code.google.com/p/sourcefourjs/wiki/auitreeSo at the start of your question you mentioned there is a setElementText() but no getElementText(). Using the techniques mentioned in that article and example is how you would write your own, however the rest of the question suggests that you don't want the value of the text attribute but the value instead.
(also that article/example is 5 years old, there are some things in there that can be done by 4gl methods now)
Hope that helps,
Reuben