You are 95% of the way there already.

Here is some pseudo-code to help you get going:
code:
$sDatabaseSource="\\SERVER\applikation data\addon\"
$sDatabaseDestination="\\profile-server\profiles\%username%\applikation data\addon\"
If Not Exist($sDatabaseDestination)
Copy $sDatabaseSource $sDatabaseDestination
If WriteValue("HKCU\Software\Add-On\Products\exchange central\paths","DefaultDatabase","\\profile-server\profiles\%username%\applikation data\addon\","REG_SZ")
"FATAL: Cannot update database path value" ?
EndIf
EndIf