Most specifically, this is covered in two treaties. Known collectively as the "Torrijos-Carter Treaties", they are "The Treaty Concerning the Permanent Neutrality and Operation of the Panama Canal", and "The Panama Canal Treaty".
Of the two, the Panama Canal Treaty covered the period from 1977 until the turnover of the canal in 1999. So the one that this clearly applies to is the "Neutrality Treaty", and Article V is quite clear.
So yes, if other nations tried to maintain a military presence in Panama the US would indeed respond with military force. Myself, I admit I have long found treaties quite interesting as they will cover a lot of things people simply have no idea about. Probably one reason I so often find myself quoting treaties in here, as they can quickly cut through the garbage propaganda that others try to spew.
Like the large number that completely ignore even the presence of the "Treaty on Friendship, Cooperation, and Partnership between Ukraine and the Russian Federation". Something that Russia clearly violated in 2014 when it invaded and annexed Crimea.