The smilies are ordered by their IDs
You can remove all smilies, and re-add them, by the order you want them to show up.
But you can do this.
Find
PHP Code:
$smilies = $DB_site->query("SELECT title, smilietext, smiliepath FROM smilie");
and replace it with
PHP Code:
$smilies = $DB_site->query("SELECT title, smilietext, smiliepath FROM smilie ORDER BY title");
This will order the smilies by their title. Meaning

(Happy) will be before

(Sad) but after

(Big Grin).