We study the design of a goal-oriented sampling and scheduling strategy through a channel with highly variable two-way random delay, which can exhibit memory (e.g., Delay and Disruption Tolerant Networks). The objective of the communication is to optimize the performance of remote inference, where an inference algorithm (e.g., a trained neural network) on the receiver side predicts a time-varying target signal using the data samples transmitted by a sensor. Previous formulations to this problem either assumed a channel with IID transmission delay, neglecting feedback delay, or considered the monotonic relation that the performance only gets worse as the input information ages. We show how, with delayed feedback, one can effectively exploit the knowledge about delay memory through an index-based threshold policy. This policy minimizes the expected time-average inference error that can be monotone or non-monotone in age. The index function is expressed in terms of the Age of Information (AoI) on the receiver side and a parameter regarding the distribution of subsequent transmission delay, both of which can readily be tracked.