Optimization-based Motion Planning and Runtime Monitoring for Robotic Agent with Space and Time Tolerances