Multiple line search cannot be done in vqmod. So you need to use the vqmod index
attribute. If the “Search” string is 'hello' and there are 5 'hello's in the file, but you only want to replace the 1st and 3rd, use Index: 1,3.
So change your vqmod code as below:
<operation>
<search position="replace" index="3"><![CDATA[if (!$this->user->hasPermission('modify', 'catalog/download')) {]]></search>
<add><![CDATA[
if (!$this->user->hasPermission('delete', 'catalog/download')) {
]]></add>
</operation>
<operation>
<search position="replace" index="3"><![CDATA[$this->error['warning'] = $this->language->get('error_permission');]]></search>
<add><![CDATA[
$this->error['warning'] = $this->language->get('error_permission_delete');
]]></add>
</operation>
Don't forget to update the index
value.
Reference links: https://sankartypo3.wordpress.com/2013/11/25/opencart-vqmod-tutorial/ , http://code.google.com/p/vqmod/wiki/Scripting
Have a nice day !!