The commented lines are what I used to change it from an inline UDF to a multi-line UDF. You're correct in that it did not solve the problem, so I changed it back. Our DBA is going to add some comments of his own.
LinkedIn: http://www.linkedin.com/in/sqlrv
Twitter: http://www.twitter.com/sqlrv
Website: http://sqlrv.com