In our case the locks are more than just map services, they are from users throughout the enterprise as well.
I've tried adding arcpy.AcceptConnections(Connection, False) followed by arcpy.DisconnectUser(Connection, "ALL") to the script prior to removing the spatial index, loading data, and rebuilding the index but have not had any success.
Ideally it would be best to have available a geoprocessing/arcpy tool that replicates exactly how load_only_io and normal_io command lines worked, which is flawless and efficient. For now we will continue to use the command line for as long as possible until we can find a viable alternative. Please let me know if there are any updates on this or tried and tested workarounds. Thanks!
Tom Weisenberger
Los Angeles County - Enterprise GIS