Shortest path problem where edge weight depends on path taken
Don't do that.  Instead, change the way you model the problem as a graph problem.

One crude approach: Rather than having a vertex for each bus stop, introduce one vertex for each pair of a bus stop and a time.  For instance, if $s$ is a bus stop and $t$ is a time, then $(s,t)$ is a vertex.  If we have a bus that goes from $s$ to $s'$, takes 5 minutes, and departs every 20 minutes, then we'd have edges $(s,0) \to (s',5)$, $(s,20) \to (s',25)$, $(s,40) \to (s',45)$, etc.  You can take it from here.  (Test for understanding: see if you can work out what the running time of finding the shortest path to some destination is.)

A smarter approach: Fix an original vertex $v_0$ (the starting point of all trips).  For each vertex $v$, compute $d(v)$, which is the time it takes to get from $v_0$ to $v$.  How do you compute $d(v)$?  Use dynamic programming.  If you know $d(u)$ for all predecessors $u$ of $v$, then you should be able to work out an easy way to compute $d(v)$.  Also, if you've studied shortest-paths algorithms, you should be able to find an ordering for assigning $d(\cdot)$ values.  This will provide an efficient algorithm.