Don’t know much about Dundee but there is some excellent riding to be had in Fife.
I lived in Aberdeen for 6 years as a student and don’t really have a bad word to say about it – really enjoyed it. Left in 2004 so not sure what state it is in at the moment regarding flat rental etc I was paying £225/month for a room on Clifton Road incl. bills. Unfortunately wasn’t into riding when I stayed there but am sure there is probably a Uni bike club you could hook up with as well as other local clubs which could sort out lifts for you etc. to riding spots outside the town.
Edinburgh is a cracking city but could be pretty expensive depending on the area you want to rent in. Everything seems to be very close by as the centre of town is pretty compact. As already said above Pentlands on your doorstep, Glentress and Innerleithen/borders down the road as well as Stirling Trossachs and Fife.
Glasgow is another quality place to live – good riding just outside the city in Mugdock and the start of the WHW – some good clubs around as well. Used to ride with Glasgow Mountain Bike Club which is a good club and regular Wed night rides and Sunday rides away from home. West End is nice and has a good mix of shops/pubs/restaurants and flats for students in Anniesland/Hillhead/Kelvinbridge/Kelvinside/Kelvindale/Partick no idea on price though. Good subway into city centre and buses etc.