Modifying .plist with shell changes .plist order
The order of key value pairs within a Property List, plist, dictionary structure is not specified and can not be relied upon.

Ideally, your application needs to parse the property list without relying on the order of the dictionary pairs.

If the order is critical to your application, consider changing the property list structure to an array of dictionaries; where each dictionary contains a single key value pair.

If you can not change your application, and the property list is formatted as XML, then you may want to investigate other command line XML manipulation tools.