Shalom! This question touches on technical details of the Laws of Shabbat and invites an interesting consideration about how we deal with halakhic situations which are less in our own control. Your question has similar applications in hotels and other places where one might need to stay on Shabbat (and to a lesser degree in walking at night on Shabbat - there usually one can walk outside the area of a motion-triggered light). To address it, we need to consider the relationship between your act and the light going on, as well as the nature of the prohibition of fluorescent lights.
The work that is prohibited on Shabbat is classified as "melekhet mahshevet" (thoughtful/constructive work). Your walking by to cause the light to go on hardly seems like that kind of work. In fact, it (the causing the light to go on) can be classified as a
davar she-eino mitkaven (an act/consequence which one did not intend, precisely as you wrote in your question). It is an inevitable consequence, however, called in halakhah a
psik reisha (from the illustration of inevitability of cutting of a chicken's head and its subsequent death!), which makes it more severe, and halakhically mitigates your claim that you don't have the intention to illuminate the hallway. But then we have a final component - your relationship to this outcome: is it good for you, not good for you, or are you indifferent? (Note, before we move to the application to your question, the beautiful "swinging pendulum" of these categories - we are lenient when you have no intention for this outcome, stricter again when it is unavoidable, and then ultimately dependent on how you benefit from that outcome. I think of these as logical and wise evolutions of the Laws of Shabbat.) If it is good for you, this is a category which is hard to permit in Orthodox halakhah. If it is neutral or not good for you, it is easier to permit (especially with the addition of other factors - see below). It's hard to say the lighting is not good for you - it helps you navigate the hallways. In cases like this, though, Orthodox authorities have written that if there is some light already so you could see your way to your room without it, you can be considered more indifferent to the new light, and this is more easily permissible. If there is no other light and you really couldn't see without this light, the only permission I am aware of (
The 39 Melochos, Rabbi Dovid Ribiat, p. 1215) is the suggestion to shut your eyes just as you enter the hallway, so you do not benefit at the time that you cause the lights to go on. Once they are own, you can proceed. As silly as this may sound, it has the spirit of helping distance yourself from this act and certainly doing it in an uncommon way - part of the way we deal with non-ideal Shabbat situations.
How about the fluorescent light? Whereas an incandescent light works by heating a metal filament, and is (widely considered) a Biblical prohibition, a fluorescent light is simply electricity exciting the neon gas in the tube, not any specific Biblical prohibition and widely considered to be a Rabbinic prohibition (unless there is a 'starter', which most fluorescent lights don't have - see details on the
Tzomet webpage
here). This combines with the unintentionality of your action and not needing the outcome, to get to a permissive response.
So: for fluorescent lights, if there is some light already in the hall, you may walk the halls. If there is very little or no light, then using the eyes-shut method is advisable. I am guessing this is a rare scenario: I imagine if you are on an active hall, the lights are often on anyway and you might be able to get in or out while they are already on from someone else's motion.
Finally, this is a fascinating instance where you feel at the mercy of a system beyond your control, but you may wish to seek accommodation from your dormitory. It can be a beautiful teaching moment and a chance to exercise your right to ask for recognition of your religious practice. If some arrangement could be made to disable the motion sensors on your hall (even just yours) on Friday and Yom Tov nights (in the daytime the halls are presumably naturally lit sufficiently already), while it would expend a little more energy, it would alleviate the halakhic challenges here.
I hope that within these minutiae of halakhah, you are able to find meaning and think about the impact of our actions, and in this case to consider the ways we do and don't have agency in the institutions we participate in.
Shabbat shalom!