Great examples! Even with short code I tend to use functions especially when they need to be nested.Repetition. If you're going to be performing a similar task over and over, having functions will save you time and add coherency to your code.
Updates. Changing how something works? Modify the function to match up, rather than have to update large portions of code.
Security. Passing data to a DB? Collecting user input? Functions can be written to sanitize data without having to put preg_replace all over your script.
Sanity. Ever go back and look at code you wrote months ago and haven't had to touch since? Ever sat there and wondered exactly what the hell you were trying to accomplish? Functions (and proper commentary) can make rarely-edited scripts much easier to comprehend.
Efficiency. Relatively minor, unless you happen to be writing some monster project. But a function only has to be 'read' once and used over and over, as opposed to having to 'read' long batches of raw code.