I feel your pain on this but may I suggest a better approach?
http://www.dbasupport.com/oracle/scr...iled/179.shtml
I think you will find that this script is better than the one you have. Yes, it's a little more complicated but it's designed for simplicity. Meaning that if you add a new datafile you won't have to edit your script he'll find it. I've used this script before and it's a good one.

good luck!