Need to add custom script as service in init.rc for Android 10
The error is 'Duplicate declaration of type'
The problem is step 5 in which you declare
type usbmountd_exec, system_file_type, file_type;
You already declared that same type usbmountd_exec in step 3. So remove the duplicate declaration.
Also in step 4 it should look like this:
/system/bin/usbmountd.sh     u:object_r:usbmountd_exec:s0