I finally beat this level. This was not particularly fun to optimize. I attempted to track different decision points and how many steps above displacement they cost, but it ended up being a giant mess. There are like two things you have to do that are kinda weird.