As being minimalist, the following single line will also work to set your param to null if it is a blank (or spaces) without any trims and checks for length (it would also work if your @path param would be of CHAR datatype):
SET @path = NULLIF(@path,'')
Actually, you don't need even that, just use:
UPDATE m
SET
Path = ISNULL(@Path,NULLIF(m.path,'')), -- don't update when no path supplied
PathReadOnly = ISNULL(@PathReadOnly,m.PathReadOnly)
FROM dbo.Mytable as m
WHERE Code = @Code