Ok, this is untested, but it should work fine and has (I think) everything asked for.

You can add quotes, view random quotes, view specific quotes, see how many quotes there are, have access in only specific channels as well as access in PM, have a 10-90min delay between when it can be used in channel and no limit in PM, and has the ability to ban a user from using it.

You will need to replace the RED text with the channel(s) that you want to allow and the BLUE text with the random time delay (600 = 10 minutes, 5400 = 90 minutes... just change the minimum and maximum to the number of seconds). Personally, I'd suggest the random time being 5-10 minutes unless it gets abused.

Code:
on *:text:!quote*:*: {
  if ($level($address($nick,8)) == Quote.Ban) { return }
  else var %who = $nick
  if ($chan) {
    if (!$istok([color:red]#channel1 #channel2 #channel3 #channel4 #channel5[/color],$chan,32)) { return }
    var %who = $chan
    if (%quote.delay) {
      .notice $nick Please try again after $duration(%quote.delay) or use !quote in a PM.
      return
    }
    else set -u [ $+ [ $rand([color:blue]600,5400[/color]) ] ] %quote.delay On
  }
  if ($2) {
    if ($2 !isnum) { msg %who $2 is not a number. | return }
    if ($lines(quotes.txt) < $2) { msg %who Quote # $+ $2 doesn't exist. | return }
    msg %who $read(quotes.txt,$2)
  }
  elseif ($1 == !quotes) { msg %who Total quotes: $lines(quotes.txt) }
  else msg %who $read(quotes.txt)
}

on *:text:!addquote:*: {
  if ($2 == $null) { .notice $nick You need to include a quote to add. }
  else write quotes.txt $2-
}

menu nick {
  !Quote Ban: auser Quote.Ban $address($snick($chan,1),8)
}


USE:
!quote = Display random quote
!quote N = Display quote #N (N is a number)
!quotes = Display the number of quotes
!addquote quote = Add the quote

Also, you can right click on a nick in the nick list and ban him/her from using !quote, !quotes, and !quote N. To unban the nick, press Alt-R, then click Users. All bans for quotes are listed as Quote.Ban:nick!*ident@*.host.com (they all start with Quote.Ban). Just delete the one(s) that you want to unban.

Feel free to change the error texts and the output texts to whatever wording sounds best to you. I included checks for errors in use to help prevent users from not understanding why something wasn't working. In fact, close to half the lines are error checks. wink

If something doesn't work, please let me know and explain as much as you can about what isn't working (including any error messages in the status and/or channel windows).

Note that if you want to use !quote yourself (and you don't have this on a bot), I'll have to include some more code for it to work for your own inputs. If you need that, just let me know.

****One final note. The quotes.txt file will *not* have line numbers in the text file. It doesn't need them for you to be able to access specific lines. The text file should include one quote per line and no line numbers.