Your approach is not entirely correct. It's true that you will not get the proper WebDAV url until component is saved, but you also can;tcan't be sure that url you have in metadata is correct at the time of publishing, let's say component is moved, in this scenario it will not be updated.
Better approach will be to do something during publishing.