With default setting
auto for the doc-type the doc-type declaration is not changed by HTML Tidy except you use one which is unknown (wrong). Check the options.
Entering
HTML Tidy in an internet search engine like Google gives you the link to the open source project
HTML Tidy. It's also in help of UltraEdit and several times here in the forum. Next time please first search.
You really have to replace just tidylib.dll in the UltraEdit program directory. But make a backup before. I don't know if the newer versions are still compatible (= have same interface to other applications like UltraEdit).
But as you can see on the HTML Tidy project page the latest version is available only as compiled EXE, not as DLL. When you want to use this version, you have to add it as user tool to UltraEdit and create yourself the configuration file with the options you want. That means you have to read now many pages to really understand the program. And this version is not running on Win98 because of missing function GetFileSizeEx in kernel32.dll.
The currently latest DLL version by Cory Nelson is older. If you want a newer DLL version, you have to compile it by yourself.