I could be stating the obvious but book Dublin-Westport return tickets for the dates online as booking separate tickets will cost more with a 2 euro charge. Online fares to both Castlebar and Westport are the same so you just get off at Castlebar and pay the 8 euro for the single to Westport lather in the day and use the return ticket from Westport whenever your coming back. In case you don't know book the online fare when you know you exact dates for cheapest fares.