JavaScript, 342 299299 307 bytes
n=>[' '+'_'.repeat(e=Math.max(...(s=n.split` `).map(l=>l.length))+2),...s.map((i,l,_,x=i.padEnd(e-1))=>s[1]=>1 in s?l?s[ll>s.length-2]2?`\\ ${x}/`:`| ${x}|`:`/ ${x}\\`:`< ${x}>`),' '+'-'.repeat(e),''].join` `+[(n=' ')+"\\ ^__^"," \\ (oo)_______",` (__)${n})\\/\\`,n+` ||----w |`,n+" || ||"].join(` `+n) Explanation
This builds an array of strings which are joined with a newline.
What each element does
- element 1: underscore string
- next few elements: each line of the inputted string with the added limiters
- next element: hyphen string
- then, add the cow string.
-43 bytes thanks to A username
+8 bytes due to empty line bug