insert_message function

Insert message into a list at a specified position