Does WINEDLLPATH allow to dynamically fallback and retry other directories in the path, if a module is found in one but fails to load from there (for instance before dynamic loader doesn't find the right library version when loading the unixlib)?
Currently no, but I'm planning to add some mechanism to load a specific file as Unixlib .so instead of hardcoding it to the name and path of the corresponding PE module. This is needed for other things like the audio driver backends.
Then it still doesn't seem convenient to configure Wine build directories for every target version (times two if you want 32bit and 64bit), just to build the winedmo module for different FFmpeg versions. In comparison the amount of effort to achieve the same thing, as done in this MR, is much lower.
Given that you would need to configure and build the various ffmpeg versions first, I'm not sure that it simplifies all that much. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9913#note_127953