Inserting a function via clicking the "commands" in the left hand window will insert the code at the cursor position unless you insert a code module. Code modules insert at the top of your script. I think (though I'm not stressed if you think otherwise) it would be nice if insertion was consistent - ie all insertions go wherever the cursor currently is. If it's going to do an insertion at the top, maybe it could insert a comment like the following so it's easy to find your original code?
-- | End of inserted code module "Ray from Object"
-- | =====================================================