Apart from a few specifics, Japanese word order isn't TOO rigid. Sentences should always follow S-O-V word order, and the topic must come before the subject, object before verb. It also sounds more natural if time comes before manner before place in terms of adverbs.
So, with your example sentences, its best to bear in mind what the verbs are referring to, because sentences are a lot easier to understand when a verb and its object are next to each other. So: 3じまで ここで いても いいですか? is more natural
same with スミスさんは きょねん ひとりで にほんに きました; and どうして びょういんは きょう 12じまで ですか?
Remember though, that its not a RULE with adverbs, so the other sentences aren't incorrect, but just sound less natural. Especially with verbs relating to movement, it makes sense to put the "place" right before the verb because thats what its really referring to.
er. hope thats not too confusing