Take a piece of paper and write down "-1 diplo for border crowding, -1 diplo for one finger salute." Put it right under the "-3 diplo for being in the way", which is a diplomacy function that the AI doesn't really have, but we humans are special. Elsewhere on the paper you might have "-4 diplo for being Greece" or "-5 diplo because I hate everyone". That part is up to you.
Absolutely loved that... most AI tend to get the "being in the way" from me. Heh.
As for the questions about the length of the promise, no it isn't listed in the code (previous poster is correct on that - the length is listed for other promises but NOT the MILITARY_PROMISE); however, I can say it does have a definitive duration.
In my current game (modded to adjust game speed and opinion durations which I can modify were increased from 50 to 60) Siam popped up that one and I didn't feel like fighting so I said my troops were "just passing through".
I never moved them (they were defensive since Siam had already DoWed me three times before I scorched all but one of their cities to the ground) and was testing the decay on Warmongering (two civs saw me a potential threat and one just had early concerns and I was timing how long until they changed - I'd taken 2-3 cities at minor penalty and one and major).
I thought I'd screwed myself and would have to wait for Siam to DoW me (unlikely at this point) but decided to run some tests. I waited about 50 turns, saved and DoWed. Got the negative modifier. So I decided to reload and wait 60... didn't get the chance because at exactly 60 turns Siam popped the same damned diplo screen up, this time I chose Declare War. Checked over next few turns other four empires had no negative modifier for a broken promise.
So even though there's no code for MILITARY_PROMISE duration in GlobalDiplomacyAIDefines, it is in someway limited in duration.
Either:
1 - Tied to one of the ones we CAN modify or the OpinionDuration under GameSpeeds, because it appeared to last 60 turns in my game, same as DoF, Expansion, Border and Spy promises.
OR
2 - Previous promise expires immediately when diplo request triggers again.
It'll take me a bit more finangling to verify which of the two is the case, but for now you can safely assume if it pops again, you can DoW because it'll either have been past the set duration or it clears the flag when re-triggered, whichever is the case it's safe to DoW the next time an AI annoys you with the message.