The first of your two alternative answer would be quite common (prepositional phrases often follow the verbs, here and in subordinate clauses where, if you're familiar with German, your verb would need to go at the end).
The second wouldn't, because "binnen" is an adverb instead of a preposition. It's pretty much regulated to the middle portion of the sentence.
Both het's are needed because they are part of two separate grammatical constructions. One is the adverbial phrase "langs het kasteel" = "along the castle," which describes where the person is. The other is the verb phrase "ben . . . aan het rennen" = "am running." It is the nature of Dutch word order that adverbial phrases (usually) get inserted into the middle of verb phrases that contain more than one word.